Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
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
Posted to microsoft.public.excel.programming
|
|||
|
|||
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
Posted to microsoft.public.excel.programming
|
|||
|
|||
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 |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Link Updates | Excel Discussion (Misc queries) | |||
Excel Link Updates | Excel Worksheet Functions | |||
Link Updates | Links and Linking in Excel | |||
Link Updates | Excel Worksheet Functions | |||
Why still asked for Link Updates? | Links and Linking in Excel |