• Macro exists? (2000 SR1a)

    • This topic has 1 reply, 2 voices, and was last updated 22 years ago.
    Author
    Topic
    #385353

    hello

    I’m helping a fellow worker automate the running of a bunch of macros in a bunch of workbooks. I’m writing a VBScript that will open a series of Excel workbooks and run a macro in each of the workbooks. The VBScript will read a CSV file that contains a list of workbooks and the macros to run in those workbooks. I’d like to make the script robust enough to skip running a macro that doesn’t exist.(i.e. maybe my fellow worker fat fingered the macro name or forgot to write a macro for that paticular workbook). Is there a way to check to see if the macro exists before running it, or do I just need to trap the error and move on?

    thankyou

    Viewing 0 reply threads
    Author
    Replies
    • #664560

      It would be possible to check if the macro exists from within a VBA routine, but it would be a bit messy. I don’t have a clue how you would do that from VBScript. Probably the easiest and most efficient would be to just trap the error.

    Viewing 0 reply threads
    Reply To: Macro exists? (2000 SR1a)

    You can use BBCodes to format your content.
    Your account can't use all available BBCodes, they will be stripped before saving.

    Your information: