Update from different sheet

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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top