ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Discussion (Misc queries) (https://www.excelbanter.com/excel-discussion-misc-queries/)
-   -   Update from different sheet (https://www.excelbanter.com/excel-discussion-misc-queries/142781-update-different-sheet.html)

shakey1181

Update from different sheet
 
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.


All times are GMT +1. The time now is 06:54 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com