Macro location

K

Karen

I have a macro in a workbook that was emailed with 2 additional workbooks
that need to use this macro. There seems to be a problem when they save the
master as a new name. They still have to bring up last month's spreadsheet to
access the macro. What are the rules for macro location and how can I
simplify this process for my users? Can it also be because they make a new
folder for each period and save the renamed master in it?.
 
J

JLGWhiz

While the code modules are saved to the new workbook along with the data on
the sheets, it can be problematic to run the code for a few reasons.

1. If the code references the name of the original workbook, it will throw
errors for subscript out of bounds.

2. If there are links to cells in the original workbook, then those links
are still there and the new workbook will be looking for those links.

and a few others. What you really need to do is contact the creator of the
workbooks and have them troubleshoot the problem.
 
D

dustinbrearton via OfficeKB.com

It is likely because they are changing the name of the file. If the code
contains any statements that refer to the original name of the workbook it
won't work in a new workbook without editing it. Is there a lot of code?
Can you find anything that references the old workbook name? If you can post
that section of code and I am sure that someone will be able to help you with
a better way to code that part.
 
K

Karen

I created the macros and audited the contents of all these spreadsheets.
There is no reference to the original sheet name in the macro. Other
spreadsheets are linked to the spreadsheets using the macro (source data
only). The original author is long gone, and it doesn't matter because I had
to do extensive revisions to accommodate a new payroll system. I will go
into the office and try to replicate their problems next week. Thanks for
trying, K
 
D

Dave Peterson

How do you call the macros?

Did you place buttons (or other shapes) on the worksheet and then assign the
macro?

Did you attach a toolbar to the workbook that points at those macros?
 
Top