Results 1 to 5 of 5
  1. #1
    WS Lounge VIP
    Join Date
    Mar 2002
    Location
    Newcazzle, UK
    Posts
    2,820
    Thanks
    133
    Thanked 481 Times in 458 Posts

    Disable macros on file open (Excel2000)

    I want to open a file from the File-Open dialog under VBA but I don't want the macros in the selected file to run.
    I seem to recall something like an 'enableFileOpenMacros' setting but my brain is in Friday mode.
    Or do I turn 'enableEvents' off temporarily or something?

    Any help much appreciated.

    zeddy

  2. #2
    Platinum Lounger
    Join Date
    Feb 2001
    Location
    Weert, Limburg, Netherlands
    Posts
    4,812
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Disable macros on file open (Excel2000)

    Hold the shift key while clicking the Enable macros Button and while the file opens.
    Jan Karel Pieterse
    Microsoft Excel MVP, WMVP
    www.jkp-ads.com
    Professional Office Developers Association

  3. #3
    WS Lounge VIP
    Join Date
    Mar 2002
    Location
    Newcazzle, UK
    Posts
    2,820
    Thanks
    133
    Thanked 481 Times in 458 Posts

    Re: Disable macros on file open (Excel2000)

    I can click the disable macros button.
    But I want to do it in VBA.

    zeddy

  4. #4
    WS Lounge VIP sdckapr's Avatar
    Join Date
    Jul 2002
    Location
    Pittsburgh, Pennsylvania, USA
    Posts
    11,225
    Thanks
    14
    Thanked 342 Times in 335 Posts

    Re: Disable macros on file open (Excel2000)

    Try Disabling the events before opening

    Steve

    <pre> Application.EnableEvents = False
    Workbooks.Open "c:Filename.xls"
    Application.EnableEvents = True </pre>


  5. #5
    WS Lounge VIP
    Join Date
    Mar 2002
    Location
    Newcazzle, UK
    Posts
    2,820
    Thanks
    133
    Thanked 481 Times in 458 Posts

    Re: Disable macros on file open (Excel2000)

    Steve
    Thanks for your reply - exactly right.

    zeddy

Posting Permissions

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