S
shakey1181
I have recorded a basic macro within a file, which opens another file, saves
it, then closes it. Reason being the other sheet needs to be opened to
update, the new data which is then read by the first sheet.
The problem I am having is that one of the files referenced in file2 doesn't
exist, so during the running of the macro, it comes up with the open file
dialogue. I have to leave this ref in file2. This needs to be cancelled for
the macro to continue. Is there anyway around this? Or even a better way to
do this? My macro currently looks like this:
ChDir "Z:\"
Workbooks.Open Filename:= _
"Z:\May.xls", UpdateLinks:=3
ActiveWorkbook.Save
ActiveWindow.Close
End Sub
Hope this all makes sense.
it, then closes it. Reason being the other sheet needs to be opened to
update, the new data which is then read by the first sheet.
The problem I am having is that one of the files referenced in file2 doesn't
exist, so during the running of the macro, it comes up with the open file
dialogue. I have to leave this ref in file2. This needs to be cancelled for
the macro to continue. Is there anyway around this? Or even a better way to
do this? My macro currently looks like this:
ChDir "Z:\"
Workbooks.Open Filename:= _
"Z:\May.xls", UpdateLinks:=3
ActiveWorkbook.Save
ActiveWindow.Close
End Sub
Hope this all makes sense.