Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Changing references in a batch of files?
Hi all,
I got a large number of Excel files, all with a reference (in the VBA editor) to another file. I wonder if it's possible to programmatically change the reference in all files, to save the repetitive work of changing each manually? Gustaf |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Changing references in a batch of files?
I don't think its possible because the compiler would break.
Why not just rename the original referenced file -- as backup- and rename the new file with the original file referenced name? "Gustaf" wrote: Hi all, I got a large number of Excel files, all with a reference (in the VBA editor) to another file. I wonder if it's possible to programmatically change the reference in all files, to save the repetitive work of changing each manually? Gustaf . |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
Changing references in a batch of files?
References are always to "another file". Depending on the type reference, ie
file, it might be easy, unreliable, or impossible. Describe "another file". Regards, Peter T "Gustaf" wrote in message ... Hi all, I got a large number of Excel files, all with a reference (in the VBA editor) to another file. I wonder if it's possible to programmatically change the reference in all files, to save the repetitive work of changing each manually? Gustaf |
#4
Posted to microsoft.public.excel.programming
|
|||
|
|||
Changing references in a batch of files?
It depends. I recently wrote a macro to open all files in a folder and
delete a procedure in a worksheet_change event and insert a new one save and close the file. Details? -- Don Guillett Microsoft MVP Excel SalesAid Software "Gustaf" wrote in message ... Hi all, I got a large number of Excel files, all with a reference (in the VBA editor) to another file. I wonder if it's possible to programmatically change the reference in all files, to save the repetitive work of changing each manually? Gustaf |
#5
Posted to microsoft.public.excel.programming
|
|||
|
|||
Changing references in a batch of files?
Have a look at Chip Pearson's site (http://www.cpearson.com/excel/vbe.aspx).
He has got some good clues on programing at the vbe editor level. There is definitely an .addreferences method in the VBE command set. You may be able to set up a loop that programmatically opens each file then redefines the reference. -- Ken "Using Dbase dialects since 82" "Started with Visicalc in the same year" "Patrick Molloy" wrote: I don't think its possible because the compiler would break. Why not just rename the original referenced file -- as backup- and rename the new file with the original file referenced name? "Gustaf" wrote: Hi all, I got a large number of Excel files, all with a reference (in the VBA editor) to another file. I wonder if it's possible to programmatically change the reference in all files, to save the repetitive work of changing each manually? Gustaf . |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
How can I batch convert 97-2003 .xls files to 2007 .xlsx files | Excel Discussion (Misc queries) | |||
VB and Batch files | Excel Programming | |||
Batch conversion of XP files to 97 files | Excel Discussion (Misc queries) | |||
Batch Files | Excel Programming | |||
Batch files and VBA | Excel Programming |