Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Macro being called by Text Button works, calling it in VBA does not

Status
Not open for further replies.

jim2011

IS-IT--Management
Jun 26, 2012
5
0
0
US
I'm trying to program a VBA script to execute a macro from an Excel Plugin (Cognos Analyst). When I use the plugin to assign the macro (Analyst_SaveButton) to a text button, it stores what I assume is the parameter value in the text of that text button. Clicking the button then executes the macro in the external XLA plugin file and succeeds. If I try running the same macro through VBA using Application.Run "Analyst_SaveButton", it does not work. I get a "VB Error 1004 in Anlyst_XLA.Analyst_SaveButton at 110: Unable to get the DrawingOBjects property of the Worksheet class". Is there any way to use VBA to act as if it were the button being clicked when calling the macro?

Thanks,
Jim
 

...and the code is??????

Skip,
[sub]
[glasses]Just traded in my old subtlety...
for a NUANCE![tongue][/sub]
 
That's the problem. The code for the macro is locked behind a password protected XLA file. That's why I want to simulate a textbutton being pressed. The textbutton has no code behind it besides to call the macro in the password protected XLA file. The macro picks up whatever the text is in the Textbutton and uses that as a parameter somehow. Any ideas?
 
I cannot advise you on a black box, about which I know nothing.

If you want to create you OWN button and macro et al, then that's achievable.

Skip,
[sub]
[glasses]Just traded in my old subtlety...
for a NUANCE![tongue][/sub]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top