Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default ChangeLinks routine stopped by Update Values dialog

Due to a server name change, we now have hundreds of Excel workbooks
with external links (in UNC form) to two other workbooks that are now
invalid. Opening one of these workbooks results in the dialog: "This
workbook contains one or more links that cannot be updated", with the
choices of Continue and Edit Links. Selecting Edit Links and browsing
to the required files (same location, just a different server name)
restores the links. The number of links in the workbook requires about
30 seconds to update.

I created a simple Visual Basic program that I'd hoped to let run
overnight, opening each workbook, changing the link paths, and saving.
It seemed very straightforward, but I have hit a snag.

Each workbook contains external links to two separate workbooks, but
when I try to change the link to the first workbook:

MyWorkbook.ChangeLink strOld1, strNew1, xlLinkTypeExcelLinks

the Excel (2002, SP3) application pops up a dialog, stopping the
program to wait for user interaction. The dialog is titled: "Update
Values:", and features the name of the second externally linked file.
That file will be updated by the next line in the program:

MyWorkbook.ChangeLink strOld2, strNew2, xlLinkTypeExcelLinks

Once I manually dismiss the Update Values dialog (and picking either OK
or Cancel works), the program runs to completion, updating all the
links to both external files. I have tried to suppress all file
dialogs by running these lines before the two ChangeLink lines above:

MyExcel.Visible = True

MyExcel.Workbooks.Add

MyExcel.AskToUpdateLinks = False

Set MyWorkbook = MyExcel.Workbooks.Open(strFile, False, False)

MyWorkbook.UpdateLinks = xlUpdateLinksNever

MyWorkbook.UpdateRemoteReferences = False

All of this results in the file opening with no prompts to update or
change links. It is only when the first ChangeLink line runs, the
program is stopped with the Update Values dialog. Swapping the order
of the two ChangeLink lines makes no difference, nor has changing the
DefaultFilePath to the same folder where both external files reside.

What am I missing?

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3,290
Default ChangeLinks routine stopped by Update Values dialog

Try...
MyExcel.DisplayAlerts = False
'your changelink code
MyExcel.DisplayAlerts = True
--
Jim Cone
San Francisco, USA
http://www.realezsites.com/bus/primitivesoftware



wrote in message
-snip-
the Excel (2002, SP3) application pops up a dialog, stopping the
program to wait for user interaction. The dialog is titled: "Update
Values:", and features the name of the second externally linked file.
That file will be updated by the next line in the program:

MyWorkbook.ChangeLink strOld2, strNew2, xlLinkTypeExcelLinks
-snip
Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Update Values Dialog Agustus Excel Programming 1 June 12th 06 06:51 PM
fastest sorting routine for 2-D array of long values RB Smissaert Excel Programming 8 May 6th 06 05:06 PM
Trapping Erros on ChangeLinks qwerty[_2_] Excel Programming 1 November 12th 05 02:07 AM
Update dialog box Tim Kredlo Excel Worksheet Functions 7 November 11th 04 07:14 PM
how to skip Update Values dialog when links change tonon-existent spreadsheets? Ken Shaffer Excel Programming 3 June 2nd 04 01:40 PM


All times are GMT +1. The time now is 03:57 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"