PDA

View Full Version : Determin if Macro is Undefined in Project Script


AndyFarr
08-11-2005, 07:56 AM
How can I Determine if Macro is Undefined in a function in a Project Script.

I have a Function that I wish to call multiple times but for it to only run if it has not already run.

Andy

kinook
08-11-2005, 08:21 AM
Function IsMacroDefined(name)
IsMacroDefined = Not vbld_AllMacros()(name) Is Nothing
End Function

AndyFarr
08-11-2005, 09:51 AM
I did try this but just using the TemporaryMacros collection but it failed.

Was unclear why?

All working now

Andy

kinook
08-11-2005, 10:04 AM
Not sure. This works equally well here for temporary macros:

Function IsMacroDefined(name)
IsMacroDefined = Not Application.Macros(vbldMacroTemporary)(name) Is Nothing
End Function