PDA

View Full Version : Solved: Update links prompt



Jokada
12-13-2005, 01:42 AM
Hi

I've written a script that copies all workbooks in a directory into annother workbook. The problem is that all those files contain links to other workbooks.
So each time the script opens a workbook that contains one or more links to other workbooks, you'll be prompted to update the links.

As you can imagine this is very annoying when you have 50 ore more files in that directory.

I've tried following code, but this does not seem to have any effect...


Application.DisplayAlerts = False
Set tWB = Workbooks.Open(FileName:=Path & FileName) 'open file, set to tWB variable
tWB.UpdateRemoteReferences = False
Application.DisplayAlerts = True

Perhaps anyone has done this before and knows a better way? :)

Thanks in advance!

Rembo
12-13-2005, 05:54 AM
Hello Jokada,


Perhaps anyone has done this before and knows a better way?

Try replacing:

Workbooks.Open(FileName:=Path & FileName)

With

Workbooks.Open(FileName:=Path & FileName, UpdateLinks:=0)

See the VBA help for the Open method for more details.

Rembo

Jokada
12-13-2005, 07:36 AM
Thx rembo! : pray2: