Solved

Dont update Links

Posted on 2011-02-16
8
407 Views
Last Modified: 2012-06-27
Hi,

I need a bit of code for Workbook Open that instructs the spreadsheet not to update its links

I dont want never as i have a button to update them later in the report

So on Workbook Open:Dont update links

Thanks
Seamus
0
Comment
Question by:Seamus2626
8 Comments
 
LVL 4

Assisted Solution

by:loki_loki
loki_loki earned 115 total points
ID: 34905080
Like this?

Sub OpenDontUpdate()

    Workbooks.Open FileName:= _

        "C:\My Documents\LinkedBook.xls", UpdateLinks:=xlUpdateLinksNever

End Sub


http://www.ozgrid.com/VBA/update-links.htm
0
 

Author Comment

by:Seamus2626
ID: 34905089
Thanks loki_loki, but will i be able to update the links afterwards or will xlUpdateLinksNever mean i cant?

Thanks
Seamus
0
 
LVL 11

Assisted Solution

by:Runrigger
Runrigger earned 115 total points
ID: 34905099
0
Gigs: Get Your Project Delivered by an Expert

Select from freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely and get projects done right.

 
LVL 33

Assisted Solution

by:jppinto
jppinto earned 115 total points
ID: 34905103
Private Sub Workbook_Open()
   With Application        
      .DisplayAlerts = False        
   End With
      ActiveWorkbook.UpdateLinks = xlUpdateLinksNever
   With Application        
      .DisplayAlerts = True
   End With
End Sub
0
 
LVL 50

Expert Comment

by:Dave Brett
ID: 34905116
You can control this behaviour from the menu  

in xl 2007
Data ... Edit Links
startup prompt
then pick
1) alert to give choice
2) no alert no update
3) no alert update

Cheers

Dave
0
 

Author Comment

by:Seamus2626
ID: 34905122
Thanks guys, i am willing to use  xlUpdateLinksNever (im 2003) however, this is going to be on open. After 2mins if the user presses the button i have to update the links, will that be affected by the fact that "xlUpdateLinksNever" is in workbook open?

Thanks
Seamus
0
 
LVL 50

Accepted Solution

by:
Dave Brett earned 155 total points
ID: 34905151
No

It will update when you run Edit Links manually, or open the source file

xlUpdateLinksNeve ris equivalent to choice (2) in the manual list

For mine you should use the manual setting as code may be disabled

Cheers

Dave
0
 

Author Closing Comment

by:Seamus2626
ID: 34905171
Perfect, thanks Dave, thanks all

Cheers,
Seamus
0

Featured Post

Gigs: Get Your Project Delivered by an Expert

Select from freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely and get projects done right.

Question has a verified solution.

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

Drop Down List with Unique/Distinct Values (Part II - ComboBox or ListBox and Data Validation List Bonus!) David Miller (dlmille) Intro This article focuses on delivering unique, sorted lists to list objects (e.g., ComboBox, ListBox) and Dat…
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 Micro Tutorial will demonstrate the scrolling table in Microsoft Excel using the INDEX function.
Excel styles will make formatting consistent and let you apply and change formatting faster. In this tutorial, you'll learn how to use Excel's built-in styles, how to modify styles, and how to create your own. You'll also learn how to use your custo…

776 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