Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2
Default Run VBA on any file open

Hi,

I have a situation where my company is shortly going to be moving our main
data file share from one server to another. One of the main problems with
this is going to be in coping where users have included included links into
their spreadsheets. It will be OK if they have done that in such a way that
the link ends up as s:\.... \whatever.xls as when we change the drive
mappings that will be catered for. But they will go clunk if the links are
in the form \\currentserver\share\....\whatever.xls

I've looked into ways of scanning the share for any files that contain links
in that form, but there are just too many problems with that (largely down
to the amount of files that we have).

My current thought is to tweak everyone's copy of Excel so that it runs a
macro whenever _any_ file is opened, do a find and replace to search for
\\currentserver\share and replace with the drive letter, but I can't figure
out how to do it. The VBA to do the find/replace is no problem... the bit
that I'm struggling with is what to do with that code. Drop it into an xlt
file that lives in each users alternate startup file location? Or an xla
that is automatically assigned? However I've tried, I just can't get the
idea to work.

Any ideas? (This is Excel 2000)

Thanks in advance.


  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 9,101
Default Run VBA on any file open

Look at this webpage on personal.xls

http://office.microsoft.com/en-us/ex...872961033.aspx

"Rob Oldfield" wrote:

Hi,

I have a situation where my company is shortly going to be moving our main
data file share from one server to another. One of the main problems with
this is going to be in coping where users have included included links into
their spreadsheets. It will be OK if they have done that in such a way that
the link ends up as s:\.... \whatever.xls as when we change the drive
mappings that will be catered for. But they will go clunk if the links are
in the form \\currentserver\share\....\whatever.xls

I've looked into ways of scanning the share for any files that contain links
in that form, but there are just too many problems with that (largely down
to the amount of files that we have).

My current thought is to tweak everyone's copy of Excel so that it runs a
macro whenever _any_ file is opened, do a find and replace to search for
\\currentserver\share and replace with the drive letter, but I can't figure
out how to do it. The VBA to do the find/replace is no problem... the bit
that I'm struggling with is what to do with that code. Drop it into an xlt
file that lives in each users alternate startup file location? Or an xla
that is automatically assigned? However I've tried, I just can't get the
idea to work.

Any ideas? (This is Excel 2000)

Thanks in advance.



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2
Default Run VBA on any file open

Thanks for that Joel. That lets me set things up so that my macros will be
available for anyone to run, but ideally I'd like a specific chunk of code
to run whenever a user opens up any file at all. I've tried adding code to
the Workbook_Open event in the personal.xls, but that doesn't seem to
automatically run. Any ideas how I persuade that to happen?



"Joel" wrote in message
...
Look at this webpage on personal.xls

http://office.microsoft.com/en-us/ex...872961033.aspx

"Rob Oldfield" wrote:

Hi,

I have a situation where my company is shortly going to be moving our
main
data file share from one server to another. One of the main problems
with
this is going to be in coping where users have included included links
into
their spreadsheets. It will be OK if they have done that in such a way
that
the link ends up as s:\.... \whatever.xls as when we change the drive
mappings that will be catered for. But they will go clunk if the links
are
in the form \\currentserver\share\....\whatever.xls

I've looked into ways of scanning the share for any files that contain
links
in that form, but there are just too many problems with that (largely
down
to the amount of files that we have).

My current thought is to tweak everyone's copy of Excel so that it runs a
macro whenever _any_ file is opened, do a find and replace to search for
\\currentserver\share and replace with the drive letter, but I can't
figure
out how to do it. The VBA to do the find/replace is no problem... the
bit
that I'm struggling with is what to do with that code. Drop it into an
xlt
file that lives in each users alternate startup file location? Or an xla
that is automatically assigned? However I've tried, I just can't get the
idea to work.

Any ideas? (This is Excel 2000)

Thanks in advance.





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
Unable to open a 82 KB XLSM file due to "Too many different cellformats" & "Converter failed to open the file." errors. Phillip Pi Setting up and Configuration of Excel 0 April 23rd 09 08:53 PM
In Excel - Use Windows Explorer instead of File Open to open file KymY Excel Discussion (Misc queries) 1 August 5th 06 09:59 PM
Open a file do a macro ( made) and open next succesive file SVTman74 Excel Programming 5 April 21st 06 10:14 PM
Open File or Switch Between Windows if File is Open Ricky Pang Excel Programming 2 July 8th 05 05:51 AM
Open File or Switch Between Windows if File is Open Ricky Pang Excel Programming 0 July 2nd 05 08:41 PM


All times are GMT +1. The time now is 05:02 AM.

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"