I have an excel 2007 file (xlsm), which looks for a file in the same directory and if it exists, it opens it and does soem stuff with it. if it doesn't exist, it displays a msgBox saying that it doesn't exist.
It has been working great all week. Today i went to run it and even though the file i am referencing is right there in the same directory, it is saying that it doesn't exist.
It seems liek right before this started happening, I got a message about macros not being allowed which was weird because its been allowing them all week. not sure if thats related or not but i went in and changed the macro security to allow it.
so here is the code i am using to check for the existence of the file:
MyFileName = "Daily Flash Sheet_Glen Eddy.xlsx"
If Dir(MyFileName, 0) = MyFileName Then
do some stuff
Else
MsgBox "File does not exist"
End If
It has been working great all week. Today i went to run it and even though the file i am referencing is right there in the same directory, it is saying that it doesn't exist.
It seems liek right before this started happening, I got a message about macros not being allowed which was weird because its been allowing them all week. not sure if thats related or not but i went in and changed the macro security to allow it.
so here is the code i am using to check for the existence of the file:
MyFileName = "Daily Flash Sheet_Glen Eddy.xlsx"
If Dir(MyFileName, 0) = MyFileName Then
do some stuff
Else
MsgBox "File does not exist"
End If