Changing macro source

  • Thread starter Thread starter Steve Boyer
  • Start date Start date
S

Steve Boyer

I wrote a proceedure in Excel 97 with links to 25 seperate
files of code and user forms, all stored in one folder.
When the proceedure file is moved to a different folder or
drive, or saved in a different folder or drive, Excel will
change the macro link source to look in the folder or
drive in which it was moved. I know I can change the link
source, but there are approximately 25 people using this
proceedure, storing it in their own filing system, which
created error when opening "cannot find file". Is there
any way to disable the automatic changing of the link
source so it will always look in the same folder and drive
for the macros?
 
Steve,

when you specify the files, did you include a path, or assume that the
filenames would always be in the current folder?

When designing for a network, I generally use a global constant to specify
the pathname of the target files. Place this in the module declarations and
it is a single point at which you can change the path for the relevant files

try adding 'global constant filepath ="\\server\folder\subfolder\ "' to the
declaration area
and then referencing the files as workbooks(filepath &"filename.xls")

Steve
 
Back
Top