Unconfigured Ad Widget

Collapse

Help with Excel 2007 and Enabling Macros

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • shy 7th
    Senior Member
    • May 2010
    • 529

    Help with Excel 2007 and Enabling Macros

    To preface this question: I work with Macros, VBA, Excel 2007 all the time. I already know how to open an excel file, enable macros, record macros, write macros from scratch, the works.

    The Question:
    What I can't figure out is how to enable macros within a file once I have already disabled them (once the "Security Warning" message bar disappears). Does anyone know how to do this without closing the file and reopening it? I have a feeling there is a button someplace that will enable macros, I just can't find it. I also tried google, but all of the results say "Click the Options button on the message bar"... Duh, thats how I disabled them! and now the message bar is gone!

    The Backstory:
    In some of my files I use the Auto_Open() macro name to automatically run the second the file is opened (and macros are enabled). However 10% of the time I actually need the macro to not run right away. So when the message bar appears that says "Security Warning Some active content has been disabled." I choose not to enable the content and close the dialog box.

    After I do my necessary work, I want to run my macros. Of course I now have no idea how to enable them without saving, closing, and reopening the file and depending on the size of the file and the slowness of our network, this could take a while.

    So back to the question: Does anyone know how to do this without closing the file and reopening it? And to clarify, I do not want to change my default security setting. I already know how to do this. I just want to be able to disable and enable macros in this file only, just this once.
    WTB .357 Lever Action:
    http://www.calguns.net/calgunforum/s...d.php?t=631719
  • #2
    JamesY
    Veteran Member
    • Apr 2006
    • 2652

    Why don't you create an option window to display "Run macros... Yes... No" at the time the file opens? From there, either run auto_run() or not.

    Comment

    • #3
      shy 7th
      Senior Member
      • May 2010
      • 529

      Thanks for taking the time to read my post and reply.

      I have employed your suggestion in the past with other files of mine, but in this case I need the macro to run without interruption.

      In this particular case I have a regular occuring event in my Outlook calendar that will open this file and a couple others on a regular basis. The macros in each file work with an SQL query embedded in each one to keep them updated. The event is scheduled to run durring my lunch break (while I am not at my desk) and therefore must run without me sitting there clicking "ok" on a Msgbox.

      So my question isn't how can I make my macros work better? They work just like I want them to.

      What I want to know is how can I make excel work better? I mean, I could have sworn they had this functionality in Excel 2003. It just confounds me that they have a button to disable, without a way to re-enable.
      WTB .357 Lever Action:
      http://www.calguns.net/calgunforum/s...d.php?t=631719

      Comment

      Working...
      UA-8071174-1