Macro Problem

M

M.A.Tyler

I have a workbook that I use almost daily, when I'm finished I save the
workbook to a different name, and reuse the original the next time. All the
macros associated work fine in the saved file with the new name. Recently I
added a new macro and prior to the save operation it works fine. However
after saving it, it needs to open the original file to run the macro? Even
then it won't perform the task because wants to run the application on the
original workbook. I recorded the macro using the macro recorder in the
original workbook, so I understand why it's happening, just don't know enough
about how to fix it. The code goes something like this: Application. Run
"Test.00.xls! tester". Test.00.xls refers to the original workbook, can that
be changed somehow to ActiveWorkbook, so it will work from each subsequent
saved file?

Thanks,

Mike.
 
G

Gary''s Student

if:

Sub tester

exists in the ActiveWorkBook, then instead of:

Application. Run "Test.00.xls! tester"

use:

Call tester
 
M

M.A.Tyler

Thanks for the help!
There are multiple testers, like tester, testerII, testerIII.....Thru
testerXII. Call tester seems to work for the first Sub, but not subsequent
Subs. I recieved the following error, Compile Error, Ambiguous Name Detected:
testerII
 
G

Gary''s Student

The error is telling us that there is more than one macro named:
testerII
available to be called.
 
M

M.A.Tyler

Yes, module 8 also holds a macro with the same name, The one I want to use is
in module 2. I can delete everything in module 8, as I don't use anymore,
will that take care of the error?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top