-
Tto find out a File is already opened
[Originally posted by Rao]
Hi All,
How do I found out that a file is already opened or not. Is there any property to get these details? Please help.
Any help is appreciated.
Thanks
-
Re:Tto find out a File is already opened
[Originally posted by bgong68]
Hi,
ÿ ÿ I have 2 ideas for you.
1. If a file is already opened you will get an error number 55 so you can do something like this.
On Error GoTo Error_Trap:
'*************************************************
' "Your_Filename_Here" should represent your
' actual file name
'*************************************************
ÿ ÿ Open "Your_FileName_Here" For Binary As 1
ÿ ÿ MsgBox "File Opened"
Error_Trap:
If Err = 55 Then
'*************************************************
' you can insert your code here to handle the
' file that is already opened
'*************************************************
ÿ ÿ MsgBox "File Already Opened"
End If
2. You can use the Close statement without a file number to close all active files before you attempt to open your file. So you could do something like this.
Close
Open "Your_FileName_Here" For Binary As 1
I hope this helps,
Barry
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Development Centers
-- Android Development Center
-- Cloud Development Project Center
-- HTML5 Development Center
-- Windows Mobile Development Center
|