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
Solved

Turn off update links using VBA

Posted on 2009-04-13
4
1,945 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
  • 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

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

This code takes an Excel list of URL’s and adds a header titled “URL List”. It then searches through all URL’s in column “A”, looking for duplicates. When a duplicate is found, it is moved to the top of the list. The duplicate URL’s are then highlig…
Excel can be a tricky bit of software to get your head around. Whilst you’ll be able to eventually get to grips with the basic understanding of how to get by, there are a few Excel tips that not everybody will even know about let alone know how to d…
This Micro Tutorial will demonstrate on a Mac how to change the sort order for chart legend values and decrpyt the intimidating chart menu.
This Micro Tutorial demonstrates in Microsoft Excel how to consolidate your marketing data by creating an interactive charts using form controls. This creates cool drop-downs for viewers of your chart to choose from.

839 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