M
marylu
I am currently writing a macro off a mapped server. However, the
pathname that I am using gives me an error.
Run-time error '1004';
'file name' could not be found. Check the spelling of the file name,
and verify that the file location is correct.
my code is as follows...
MyPath = ActiveWorkbook.Path
ChDir MyPath
MyFile = Dir(MyPath + "\*.xls")
'MsgBox "The File is " & MyFile
Do While MyFile <> ""
While (MyFile = "MasterList.xls")
MyFile = Dir
Wend
Workbooks.Open Filename:=MyFile
Sheets("Info").Select
....... and it continues on.
This code works fine as long as its in my local directories, such as in
C: or the desktop. However, if i run off the mapped drive it won't
work. Please help.
pathname that I am using gives me an error.
Run-time error '1004';
'file name' could not be found. Check the spelling of the file name,
and verify that the file location is correct.
my code is as follows...
MyPath = ActiveWorkbook.Path
ChDir MyPath
MyFile = Dir(MyPath + "\*.xls")
'MsgBox "The File is " & MyFile
Do While MyFile <> ""
While (MyFile = "MasterList.xls")
MyFile = Dir
Wend
Workbooks.Open Filename:=MyFile
Sheets("Info").Select
....... and it continues on.
This code works fine as long as its in my local directories, such as in
C: or the desktop. However, if i run off the mapped drive it won't
work. Please help.