Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default open without link update


I have produced a procedure that opens up a external worksheet, searchs
for a value and then returns to original sheet and pastes, this is in a
loop and continues until it runs out of things to find.

My problem is i would only like to open the excel file once and see the
message box that asks whether you want to update links once. At present
it is asking me on every loop.

I have been using this within my loop
Set bk2 = Workbooks.Open(filepath2)

Ive also tried to use this statement before loop starts and then try
bk2.activate
but this still brings up the message box and asks to update links.

How can i either suppress this message or just update file at the start
of the loop and avoid being asked again? thanks


--
cereldine
------------------------------------------------------------------------
cereldine's Profile: http://www.excelforum.com/member.php...o&userid=32069
View this thread: http://www.excelforum.com/showthread...hreadid=531884

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 6,953
Default open without link update

Note that this code does not select bk2 - there usually is not reason to.

Dim bk1 as Workbook, bk2 as Workbook
Dim cell as Range, rng as Range
Dim rng1 as Range
Set bk1 = Activeworkbook
Set bk2 = Workbooks.Open(filepath2, UpdateLinks:=1)
for each cell in Bk1.worksheets(1).Range("A1:A10")
set rng = bk2.Worksheets(1).Cells
set rng1 = rng.Find(cell.Value)
if not rng1 is nothing then
cell.offset(0,1).value = rng1.offset(0,2).value
end if
Next
bk2.close SaveChanges:=False


--
Regards,
Tom Ogilvy


"cereldine" wrote:


I have produced a procedure that opens up a external worksheet, searchs
for a value and then returns to original sheet and pastes, this is in a
loop and continues until it runs out of things to find.

My problem is i would only like to open the excel file once and see the
message box that asks whether you want to update links once. At present
it is asking me on every loop.

I have been using this within my loop
Set bk2 = Workbooks.Open(filepath2)

Ive also tried to use this statement before loop starts and then try
bk2.activate
but this still brings up the message box and asks to update links.

How can i either suppress this message or just update file at the start
of the loop and avoid being asked again? thanks


--
cereldine
------------------------------------------------------------------------
cereldine's Profile: http://www.excelforum.com/member.php...o&userid=32069
View this thread: http://www.excelforum.com/showthread...hreadid=531884


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 link cells without open up source document files patty Excel Worksheet Functions 1 February 15th 08 09:25 PM
2003 update link when Source open tim Excel Worksheet Functions 3 January 17th 05 06:25 AM
How to disable 'Update alert' when open a spreadsheet has link to other XLS Chong Moua Excel Programming 0 July 9th 03 11:59 PM
How to disable 'Update alert' when open a spreadsheet has link to other XLS andres a Excel Programming 0 July 9th 03 11:26 PM
How to disable 'Update alert' when open a spreadsheet has link to other XLS Jose Rojas Excel Programming 0 July 9th 03 11:14 PM


All times are GMT +1. The time now is 03:44 PM.

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

About Us

"It's about Microsoft Excel"