I am using macros to update the links in my current workbook to other closed workbooks.
I have used the same code twice for links in 2 different workbooks:
ActiveWorkbook.UpdateLink Name:= _
"U:\Finance\Reporting\Dailies\Data\<file name>.xlsx", Type:=xlExcelLinks
The UpdateLink code for each file is in an independent macro
I have another "master" macro which calls each of these 2 macros as well as a couple other macros in the workbook.
I have a control object ("button") in the sheet to which this "master" macro is assigned.
~ Both UpdateLink macros run perfectly if I run them independently from Excel (ie: Developer, Macros, Macro Name, Run)
~ The "master" macro which combines the 2 UpdateLink macros runs perfectly in debug mode.
~ When I run the "master" macro from the control object in my worksheet, I get the following error:
Run-time error '1004': Method of 'UpdateLink' of object '_Workbook' failed
~ After rem'ing out each of the UpdateLink macros from the "master" macro, I have determined that one of the updates works fine and the other is the problem. I have also determined that it does not matter which order I call them in, the same Updatelink macro always causes the error.
Since they run independently and they run combined in debug mode, I'm at a loss as to what is causing the error or how to fix it. Help!!!
Bookmarks