Solved

Turn off update links using VBA

Posted on 2009-04-13
4
1,955 Views
Last Modified: 2013-11-27
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

0
Comment
Question by:LizzJ
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
4 Comments
 
LVL 59

Expert Comment

by:Chris Bottomley
ID: 24135364
Hello LizzJ,

Try using the constant 3 instead of xlUpdateLinksAlways

Regards,
Chris
0
 
LVL 50

Accepted Solution

by:
Dave Brett earned 500 total points
ID: 24135372
You could turn off alerts as below
Cheers
Dave

xlPath = "c:\test2"
     Set acExcel = CreateObject("Excel.Application")
     acExcel.Visible = True
     acExcel.DisplayAlerts = False
     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.DisplayAlerts = True
     acExcel.Quit
     Set acExcel = Nothing

Open in new window

0
 
LVL 50

Expert Comment

by:Dave Brett
ID: 24135384
Just checking  - I presume you want to update links, but kill the message box?
0
 

Author Comment

by:LizzJ
ID: 24135503
Thank you all. But Dave's solution works.
0

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Do you use a spreadsheet like Microsoft's Excel?  Have you ever wanted to link out to a non excel file on your computer or network drive?  This is the way I found to do it!
This article describes a method of delivering Word templates for use in merging Access data to Word documents, that requires no computer knowledge on the part of the recipient -- the templates are saved in table fields, and are extracted and install…
This Micro Tutorial will demonstrate how to use longer labels with horizontal bar charts instead of the vertical column chart.
Do you want to know how to make a graph with Microsoft Access? First, create a query with the data for the chart. Then make a blank form and add a chart control. This video also shows how to change what data is displayed on the graph as well as form…

696 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question