Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 69
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,298
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 54
Default 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
.

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,600
Default 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



  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 10,124
Default 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




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
How can I batch convert 97-2003 .xls files to 2007 .xlsx files Dave Nuttall Excel Discussion (Misc queries) 4 August 3rd 09 11:38 PM
VB and Batch files JT Excel Programming 1 October 28th 05 08:07 PM
Batch conversion of XP files to 97 files AG Excel Discussion (Misc queries) 2 October 2nd 05 02:08 PM
Batch Files Mitch[_2_] Excel Programming 4 October 4th 03 04:40 PM
Batch files and VBA daver676 Excel Programming 2 September 17th 03 06:57 PM


All times are GMT +1. The time now is 01:43 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"