I have a really weird one with a Shape that has it's onaction set to a macro. I have a shape where the parameter I want to use is stored in the AlternativeText of the shape. the line below is setting the OnAction command to call a macro named "getApplicationTab" passing the alternativetext as a paramater.
sh.OnAction = "'getApplicationTab """ & sh.AlternativeText & """'"
This code works perfectly except for the first time it is invoked when you open the workbook. When I first open the workbook and click on the shape I get the error Cannot run the macro "getApplicationTab "Online Banking"". The macro may not be available in this workbook or all macros may be disabled.
The funny this is when I click the shape a second time it works perfectly and continues to work.
sh.OnAction = "'getApplicationTab """ & sh.AlternativeText & """'"
This code works perfectly except for the first time it is invoked when you open the workbook. When I first open the workbook and click on the shape I get the error Cannot run the macro "getApplicationTab "Online Banking"". The macro may not be available in this workbook or all macros may be disabled.
The funny this is when I click the shape a second time it works perfectly and continues to work.