ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Macro Problem (https://www.excelbanter.com/excel-programming/412613-macro-problem.html)

M.A.Tyler

Macro Problem
 
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.

Gary''s Student

Macro Problem
 
if:

Sub tester

exists in the ActiveWorkBook, then instead of:

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

use:

Call tester
--
Gary''s Student - gsnu200791


"M.A.Tyler" wrote:

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.


M.A.Tyler

Macro Problem
 
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

"Gary''s Student" wrote:

if:

Sub tester

exists in the ActiveWorkBook, then instead of:

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

use:

Call tester
--
Gary''s Student - gsnu200791


"M.A.Tyler" wrote:

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.


Gary''s Student

Macro Problem
 
The error is telling us that there is more than one macro named:
testerII
available to be called.
--
Gary''s Student - gsnu200791


"M.A.Tyler" wrote:

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

"Gary''s Student" wrote:

if:

Sub tester

exists in the ActiveWorkBook, then instead of:

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

use:

Call tester
--
Gary''s Student - gsnu200791


"M.A.Tyler" wrote:

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.


M.A.Tyler

Macro Problem
 
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?

"Gary''s Student" wrote:

The error is telling us that there is more than one macro named:
testerII
available to be called.
--
Gary''s Student - gsnu200791


"M.A.Tyler" wrote:

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

"Gary''s Student" wrote:

if:

Sub tester

exists in the ActiveWorkBook, then instead of:

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

use:

Call tester
--
Gary''s Student - gsnu200791


"M.A.Tyler" wrote:

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.



All times are GMT +1. The time now is 02:41 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com