ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Don't Update Links to Ext Workbooks using VBA (https://www.excelbanter.com/excel-programming/289687-dont-update-links-ext-workbooks-using-vba.html)

SuperJas

Don't Update Links to Ext Workbooks using VBA
 
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.

Dave Peterson[_3_]

Don't Update Links to Ext Workbooks using VBA
 
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.

SuperJas wrote:

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.


--

Dave Peterson



All times are GMT +1. The time now is 07:24 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com