I can't explain what is wrong with this simple code. It works perfectly on Excel 2003, but in Excel 2010 it displays:
Compile error: Sub of Function not defined.
Can anyone explain why is there an error on Excel 2010?
Sub Test_File_Opened()
If IsFileOpen("D:\Test.xls") Then
MsgBox "File is open!"
Else
MsgBox "File is closed!"
End If
End Sub
IsFileOpenfunction as well. It should be included when you transfer your code from 2003 to 2010. - L42IsFileOpenis not an inbuilt VBA function. - rusk