Results 1 to 2 of 2
  1. #1
    New Lounger
    Join Date
    Jan 2003
    Location
    Colorado Springs, Colorado, USA
    Posts
    22
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Macro exists? (2000 SR1a)

    <img src=/S/hello.gif border=0 alt=hello width=25 height=29>

    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?

    <img src=/S/thankyou.gif border=0 alt=thankyou width=40 height=15>

  2. #2
    Uranium Lounger
    Join Date
    Jan 2001
    Location
    South Carolina, USA
    Posts
    7,295
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Macro exists? (2000 SR1a)

    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.
    Legare Coleman

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •