Results 1 to 3 of 3

Get Macro Name (while it's running).

Threaded View

  1. #1
    Registered User
    Join Date
    11-04-2010
    Location
    Ottawa, Ontario, Canada
    MS-Off Ver
    Excel 2002
    Posts
    13

    Question Get Macro Name (while it's running).

    Hi everyone,

    I've implemented an error system in my program (using VBA in Excel). I would like know if there's an easy way to capture the name of a running macro.

    Given that this is an error handleling system, I'd rather use excel coding to get the macro name rather than manually putting the name every time i launch a routine/function as this might lead to other errors due to typos, routine changes, etc.

    The closest I've come across is this code:

    Application.VBE.ActiveVBProject.VBComponents("MyModule").?????
    
    ' which could also be ...
    
    Application.VBE.ActiveVBProject.VBComponents(Application.VBE.ActiveCodePane.CodeModule
    ).?????
    Any thoughts on how I could get the name of the macro ???

    Any help is apprecited.
    Last edited by CEC; 10-05-2011 at 08:45 AM. Reason: Capture macro name while running

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

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

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1