snb
04-15-2012, 01:29 PM
If a moderator isn't 'staff' in this forum who is ?
I can only send PM's to 'staff' but I have no idea how to find them.
I found xld's article in the kb on checking whether a file is open or not.
An alternative could be:
Function IsFileOpen(FileName As String)
On Error Resume Next
Open FileName For Input Lock Read As #1
Close
IsFileOpen = Err <> 0 And Dir(FileName) <> ""
End Function
Sub test()
If IsFileOpen("C:\MyTest\volker2.xls") Then Workbooks.Open "C:\MyTest\volker2.xls"
End Sub
But the next code is equivalent:
sub snb()
getobject "C:\Mytest\volker2.xls"
end sub
I can only send PM's to 'staff' but I have no idea how to find them.
I found xld's article in the kb on checking whether a file is open or not.
An alternative could be:
Function IsFileOpen(FileName As String)
On Error Resume Next
Open FileName For Input Lock Read As #1
Close
IsFileOpen = Err <> 0 And Dir(FileName) <> ""
End Function
Sub test()
If IsFileOpen("C:\MyTest\volker2.xls") Then Workbooks.Open "C:\MyTest\volker2.xls"
End Sub
But the next code is equivalent:
sub snb()
getobject "C:\Mytest\volker2.xls"
end sub