PDA

View Full Version : How to check on open event for macro



wolf.stalker
02-12-2010, 06:23 AM
Hi all and thanks for posting.

I am sure this is easier than I think it is, but at the moment it is escaping me how to do this.

here is the list of events i am trying to make happen

1) workbook opens
2) workbook then checks to see if a certain macro is in said toolbar...

the why.

i have a workbook. i have many users in my workbook that all use my toolbars. i want to make sure when i update my toolbars and distribute them to everyone, that they in fact install them.

i am not an network admin and can't "push" any updates so this will have to be done by the end user :-D

Bob Phillips
02-12-2010, 06:50 AM
You could use APplication.Run with an error handler, like so




On Error GoTo NoMacro
Application.Run "MySub"
Exit Sub
NoMacro:
MsgBox "Macro not installed"


Of course, as you want to test for existence, probably best if you have a dummy macro on the toolbar, specifically to do this test, but does no real work.