Link to home
Start Free TrialLog in
Avatar of LizzJ
LizzJ

asked on

Turn off update links using VBA

Hi Experts,

I'm having trouble turning off the dialog box for user to choose update/edit the links in a Excel workbook using VBA. The codes are written in Access:

The prompt still appears although I set it as update always.
Can anyone help?
Thanks.
Dim acExcel, wb
     Dim xlPath
     xlPath = "F:\xxxxxx"
     Set acExcel = CreateObject("Excel.Application")
     acExcel.Visible = True
     Set wb = acExcel.Workbooks.Open(Filename:=xlPath, UpdateLinks:=xlUpdateLinksAlways)
     With wb.worksheets("Sheet1")
     '--------work on the data-------------
     End With
     wb.Close False
     Set wb = Nothing
     acExcel.Quit
     Set acExcel = Nothing

Open in new window

Avatar of Chris Bottomley
Chris Bottomley
Flag of United Kingdom of Great Britain and Northern Ireland image

Hello LizzJ,

Try using the constant 3 instead of xlUpdateLinksAlways

Regards,
Chris
ASKER CERTIFIED SOLUTION
Avatar of Dave
Dave
Flag of Australia image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Just checking  - I presume you want to update links, but kill the message box?
Avatar of LizzJ
LizzJ

ASKER

Thank you all. But Dave's solution works.