Iver Erling Arva
asked on
Calling a macro in another open Excel workbook, Excel automatically adds path and hence cannot find macro.
Hi!
This happens in Excel 2013:
1. I open a macro enabled workbook A
2. In that workbook A, I open workbook B using a macro calling a template B0.
3. Both workbooks A and B0 are stored in the same directory C:\Excelstuff\myDir
4. In Workbook B, there is a button connected to a macro.
5. The macro is stored in Workbook A.
6. In the properties of the button in workbook B0 (tablet), the reference entered is to WorkbookA!This workbook.Macro1
7.When I try to click the button in the newly opened workbook A, it tells me that the macro cannot be found. The reason is that the path C:\Excelstuff\myDir is automatically added in front of WorkbookA!ThisWorkbook.Mac ro1
Can anyone please help!
Thanks!
This happens in Excel 2013:
1. I open a macro enabled workbook A
2. In that workbook A, I open workbook B using a macro calling a template B0.
3. Both workbooks A and B0 are stored in the same directory C:\Excelstuff\myDir
4. In Workbook B, there is a button connected to a macro.
5. The macro is stored in Workbook A.
6. In the properties of the button in workbook B0 (tablet), the reference entered is to WorkbookA!This workbook.Macro1
7.When I try to click the button in the newly opened workbook A, it tells me that the macro cannot be found. The reason is that the path C:\Excelstuff\myDir is automatically added in front of WorkbookA!ThisWorkbook.Mac
Can anyone please help!
Thanks!
Hi,
pls verify the spelling of your "assign to" macro
Regards
pls verify the spelling of your "assign to" macro
Regards
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Now it works as expected.
In your question you seem to swap between referring to "B0" as a 'template', a 'tablet', & a 'workbook', so am I not entirely sure what it being called within "B0", but can you move "Macro1" in "WorkbookA" from 'ThisWorkbook' to a Public code module to establish if the reason for it not being found is because it is Private to "WorkbookA"?