+ Reply to Thread
Results 1 to 4 of 4

Run Macro After User Enables Macros

  1. #1
    Registered User
    Join Date
    02-02-2010
    Location
    Indianapolis, Indiana, USA
    MS-Off Ver
    Office Pro 2007 at Work - Office 2010 Beta at Home
    Posts
    23

    Run Macro After User Enables Macros

    I know that you can enable a workbook to run a macro upon opening, but that doesn't work if a user of the workbook doesn't have macros automatically enabled... at least that's how it works from my understanding.

    With that in mind, how would I create a macro to run immediately after a user enables Macros and ActiveX?

  2. #2
    Forum Expert Palmetto's Avatar
    Join Date
    04-04-2007
    Location
    South Eastern, USA
    MS-Off Ver
    XP, 2007, 2010
    Posts
    3,978

    Re: Run Macro After User Enables Macros

    How would I create a macro to run immediately after a user enables Macros and ActiveX?
    Either place the code or call the sub within the module named "ThisWorkbook" and use the workbook_open event.

    Please Login or Register  to view this content.
    Palmetto

    Do you know . . . ?

    You can leave feedback and add to the reputation of all who contributed a helpful response to your solution by clicking the star icon located at the left in one of their post in this thread.

  3. #3
    Registered User
    Join Date
    02-02-2010
    Location
    Indianapolis, Indiana, USA
    MS-Off Ver
    Office Pro 2007 at Work - Office 2010 Beta at Home
    Posts
    23

    Re: Run Macro After User Enables Macros

    Could you explain more, please? I am unfamiliar with programming.

  4. #4
    Forum Expert Palmetto's Avatar
    Join Date
    04-04-2007
    Location
    South Eastern, USA
    MS-Off Ver
    XP, 2007, 2010
    Posts
    3,978

    Re: Run Macro After User Enables Macros

    First, a user must the macro security setting to Medium (pre-2007 versions) or "Disable all macros with notification for 2007.

    Unless the macro security is set to these options, users will not be prompted to enable macros

    As for creating macros, the easiest way to get started is to use the macro recorded built in to Excel, then post the code to the forum and provide a clear explanation of what you are trying to do, accompanied by a sample workbook that illustrates the desired results.

    For macros to run automatically, the code must either reside in (or the macro called) the module named "Thisworkbook" using the event know as the workbook_open event.

    All macro-enable workbooks have a module for the workbook and worksheets. There is also a standard modules and class modules that can be inserted when needed.

    The question of creating macros and modules can be lengthy. I suggest you record a macro, search the forum for specific questions related to your task and follow my suggestion above about posting code/workbooks for further help.

+ 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