+ Reply to Thread
Results 1 to 4 of 4

Running a macro from a different module

  1. #1
    Registered User
    Join Date
    02-22-2007
    Posts
    47

    Running a macro from a different module

    Hello!

    I have got 2 modules (one per procedure) in the same project and would like to make the first Marco run right after the second one is over.

    The workbook is open and will be active when the second marco finishes.

    Thx!

  2. #2
    Forum Expert shg's Avatar
    Join Date
    06-20-2007
    Location
    The Great State of Texas
    MS-Off Ver
    2003, 2010
    Posts
    40,678
    Please Login or Register  to view this content.

  3. #3
    Registered User
    Join Date
    02-22-2007
    Posts
    47
    Quote Originally Posted by shg
    Please Login or Register  to view this content.
    Thank you! What's important to note is that the Module Name containing any of the two macros (Macro1 or Macro2) should be different from the names of these macros - otherwise there will be an error saying:

    Compile error:
    Expected variable or procedure, not module
    Which means to me that you cannot run a module from a different module, can anyone confirm?

  4. #4
    Forum Expert shg's Avatar
    Join Date
    06-20-2007
    Location
    The Great State of Texas
    MS-Off Ver
    2003, 2010
    Posts
    40,678
    It means don't give a module the same name as a procedure.

+ Reply to Thread

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