Assign Macro to Custom Button Error

K

kdinardi

I have multiple customized buttons that each use different macros. However I
keep having this problem where the buttons associate with a third macro
button. for example I have three buttons, one is called reprint, one is
updateaddins, and the last is BISCAL. for the last two buttons, everytime i
open excel they associate with "reprint.xla!updateaddins" and
"reprint.xla!biscal", when they should only associate with their respected
names, the add ins also do it with different excel spreadsheet names, or just
about anything and i cannot purposely recreate the error, it just happens.

The buttons are already present, so I just want to make sure that I assign
the correct macro name to the button. Here is the code I have, I keep getting
an error on the commandbars line. I am pretty sure the syntax is wrong, but I
cant seem to figure out how to make it work correctly since all examples talk
about adding the button and I already have the button...

If chkCtrlA.Value = True Then
AddIns("Ctr+lA Validate").Installed = False
AddIns.Add Filename:= _
"\\Server\Drivers & Applications\Add-Ins\Validate\Ctrl+A Validate.xla"
AddIns("Ctr+lA Validate").Installed = True
CommandBars("CtrlA").Controls(2).OnAction = "ctrla"
End If

any ideas would be great, i keep getting error '2147024809' the 'ctr+A
validate.xla!auto_add' cannot be found.
 

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