Open and update spreadsheet

lynxbci

Registered User.
Local time
Today, 01:44
Joined
Nov 27, 2007
Messages
73
Hi,
I have the following code to open and update a spreadsheet, that is linked to another source. No changes are being made, just simply opening, updating links and saving.
Code:
Dim xl As Excel.Application
Dim wb As Excel.Workbook
Set xl = New Excel.Application
xl.DisplayAlerts = False
xl.Visible = False
Set wb = xl.Workbooks.Open("J:\Ops\QC\Transfer.xlsx", UpdateLinks:=1)
wb.Close savechanges = True
Set xl = Nothing
This code functions, but doesn't update links, just opens, and saves...
What have i missed out?

Thanks in advance
 
Thanks, but it still doesn't work, opens the spreadsheet, but isn't updating it before saving. The reason it needs to update is that it is linked to another file. Any other suggestions?
 
Try putting wb.Save before wb.Close.

And if you do it manually do the links get updated?
 
Seems to have sorted it, such a smiple thing.

Thanks very much for the support
 

Users who are viewing this thread

Back
Top Bottom