Hello,
I have set up a scheduled task to update links in a workbook. This scheduled task just calls a macro in the workbook that updates external links. The problem I am having is that the scheduled task does not want to update the links. It only works when I run the macro directly from the Excel workbook. I have tried everything from changing the update links # (0,1,2,3) to changing the Startup Prompts in the Links section. I have no idea what I am doing wrong. Help please!!
This is the code used in the scheduled task:
[pre]
[/pre]
I have set up a scheduled task to update links in a workbook. This scheduled task just calls a macro in the workbook that updates external links. The problem I am having is that the scheduled task does not want to update the links. It only works when I run the macro directly from the Excel workbook. I have tried everything from changing the update links # (0,1,2,3) to changing the Startup Prompts in the Links section. I have no idea what I am doing wrong. Help please!!
This is the code used in the scheduled task:
[pre]
Code:
wscript.sleep 2000
Set oExcelApp = CreateObject("Excel.Application")
oExcelApp.Visible = True
oExcelApp.Workbooks.Open ("cgassv0001revenueDSSRevenue files to link to portal_2010Club_Med_Artist_2013-2014.xlsm")
oExcelApp.Run ("UpdateLinks")
oExcelApp.Quit
This is the VBA code for the "UpdateLinks" macro called above. This is stored in the actual workbook.
ChDir "O:PatrickDBSAllotmentsLMA"
Workbooks.Open Filename:= _
"O:PatrickDBSAllotmentsLMAWinter2012mission1.xlsm", _
UpdateLinks:=0
ChDir "O:DSSTransport files to link to portal_2010"
Workbooks.Open Filename:= _
"O:DSSTransport files to link to portal_2010New Payload Report_S13.xlsm", _
UpdateLinks:=0
ActiveWorkbook.Save
Workbooks.Open Filename:= _
"O:DSSTransport files to link to portal_2010Payload Report_W14.xlsm", _
UpdateLinks:=0
ActiveWorkbook.Save
Windows("Club_Med_Artist_2013-2014.xlsm").Activate
ActiveWorkbook.Save