Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
CLR CLR is offline
external usenet poster
 
Posts: 594
Default Open, allow link updates, and Save

Hi All..........

If someone would be so kind, I am in need of a macro that will reside in a
Master WorkBook and when run as a "before save event", would open and allow
update all links therein, and save, one at a time, all other .xls files in
the same directory whose filename start with "XY-" no
quotes............exact quantity of the files is unknown, but may be 10 to
100. Any other files in the directory, including the Master, not having the
leading "XY-" in their filename are not to be affected.


TIA..........

Vaya con Dios,
Chuck, CABGx3




  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default Open, allow link updates, and Save

Dim v() as String
Dim sName as String
Dim i as Long, j as Long
redim v(1 to 100)

sName = dir( _
thisworkbook.Path & "\XY-*.xls")
i = 0
Do while sName < ""
i = i + 1
v(i) = thisworkbook.Path & "\" & sname
sName = Dir()
Loop
redim preserve v(1 to i)
for j = 1 to ubound(v)
set bk = workbooks.Open( _
FileName:=v(j), UpdateLinks:=3)
bk.close Savechanges:=True
Next

Untested, but this should be something like what you are looking for (as I
understand you question and it wasn't real clear). Assumes master does not
start with XY-



--
Regards,
Tom Ogilvy



"CLR" wrote in message
...
Hi All..........

If someone would be so kind, I am in need of a macro that will reside in a
Master WorkBook and when run as a "before save event", would open and

allow
update all links therein, and save, one at a time, all other .xls files in
the same directory whose filename start with "XY-" no
quotes............exact quantity of the files is unknown, but may be 10 to
100. Any other files in the directory, including the Master, not having

the
leading "XY-" in their filename are not to be affected.


TIA..........

Vaya con Dios,
Chuck, CABGx3






  #3   Report Post  
Posted to microsoft.public.excel.programming
CLR CLR is offline
external usenet poster
 
Posts: 594
Default Open, allow link updates, and Save

Unbelieveably cool.............it works perfectly.........

You are a Prince among us mortals Tom..........

Thank you ever so much.......

Vaya con Dios,
Chuck, CABGx3



"Tom Ogilvy" wrote in message
...
Dim v() as String
Dim sName as String
Dim i as Long, j as Long
redim v(1 to 100)

sName = dir( _
thisworkbook.Path & "\XY-*.xls")
i = 0
Do while sName < ""
i = i + 1
v(i) = thisworkbook.Path & "\" & sname
sName = Dir()
Loop
redim preserve v(1 to i)
for j = 1 to ubound(v)
set bk = workbooks.Open( _
FileName:=v(j), UpdateLinks:=3)
bk.close Savechanges:=True
Next

Untested, but this should be something like what you are looking for (as I
understand you question and it wasn't real clear). Assumes master does

not
start with XY-



--
Regards,
Tom Ogilvy



"CLR" wrote in message
...
Hi All..........

If someone would be so kind, I am in need of a macro that will reside in

a
Master WorkBook and when run as a "before save event", would open and

allow
update all links therein, and save, one at a time, all other .xls files

in
the same directory whose filename start with "XY-" no
quotes............exact quantity of the files is unknown, but may be 10

to
100. Any other files in the directory, including the Master, not having

the
leading "XY-" in their filename are not to be affected.


TIA..........

Vaya con Dios,
Chuck, CABGx3








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
Link Updates Keith Excel Discussion (Misc queries) 0 February 29th 08 07:10 PM
Excel Link Updates Tracy B. Excel Worksheet Functions 0 February 21st 06 01:16 PM
Link Updates joeeng Links and Linking in Excel 1 December 10th 05 12:04 AM
Link Updates Danny Excel Worksheet Functions 0 September 22nd 05 07:14 PM
Why still asked for Link Updates? Steven M. Britton Links and Linking in Excel 5 April 16th 05 12:22 AM


All times are GMT +1. The time now is 06:42 PM.

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"