Don't Update Links to Ext Workbooks using VBA

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hi,

Is there a piece of code that I can use within the Workbook_Open event that will automatically say "don't update links"?

I wish to stop the AskToUpdateLinks coming up, but can't use the Application.AskToUpdateLinks=False, since I don't want the links updated.

Thanks for your help!

SuperJas.
 
From a previous post:

xl2002 added an option for this under
Edit|links|startup prompt

But before that you have to let individual users decide for themselves--and they
can choose to be prompted or to not to be prompted, but have the links update.

In earlier versions, you could use a helper workbook that opens the workbook
with the links. That code in that helper workbook could specify how to open the
workbook with links.

Kind of like:

Option Explicit
Sub auto_open()
Workbooks.Open Filename:="c:\my documents\excel\book2.xls", UpdateLinks:=0
ThisWorkbook.Close savechanges:=False
End Sub

(see VBA's help for all the options for updatelinks.)

But the problem is that the linking question comes before any VBA code (in the
workbook with links) is executed.)

That's why the helper workbook is useful.
 
Back
Top