+ Reply to Thread
Results 1 to 5 of 5

Disable Macros when loading a Workbook in Excel 2000

  1. #1
    Remy
    Guest

    Disable Macros when loading a Workbook in Excel 2000

    Hey
    Is there a way to switch off macros when you open a workbook with Excel
    2000 via Automation?
    I know there is the
    excelApp.AutomationSecurity =
    soAutomationSecurity.msoAutomationSecurityForceDisable;
    in Excel 2003, but that is not around for 2000 yet.
    Also, setting
    EnableEvents = false
    is not working either. Seems to be a bug according to MS.

    Thanks

    Remy Blaettler
    www.collaboral.com


  2. #2
    Dave Peterson
    Guest

    Re: Disable Macros when loading a Workbook in Excel 2000

    Can you open the workbooks after you disable events:

    dim wkbk as workbook
    application.enableevents = false
    set wkbk = workbooks.open(...)
    application.enableevents = true

    And if you do anything to the workbook, turn off events before you do it.

    Wouldn't that be the equivalent of disabling macros???



    Remy wrote:
    >
    > Hey
    > Is there a way to switch off macros when you open a workbook with Excel
    > 2000 via Automation?
    > I know there is the
    > excelApp.AutomationSecurity =
    > soAutomationSecurity.msoAutomationSecurityForceDisable;
    > in Excel 2003, but that is not around for 2000 yet.
    > Also, setting
    > EnableEvents = false
    > is not working either. Seems to be a bug according to MS.
    >
    > Thanks
    >
    > Remy Blaettler
    > www.collaboral.com


    --

    Dave Peterson

  3. #3
    Tom Ogilvy
    Guest

    Re: Disable Macros when loading a Workbook in Excel 2000

    Dave, I think he has tried that and is making reference to this article:

    http://support.microsoft.com/default...b;en-us;211626
    XL2000: EnableEvents Property Does Not Work in Automation Server

    So the solution for that case is a macro run from within Excel that disables
    events. How that is implemented by the OP is their decision.

    --
    Regards,
    Tom Ogilvy



    "Dave Peterson" <[email protected]> wrote in message
    news:[email protected]...
    > Can you open the workbooks after you disable events:
    >
    > dim wkbk as workbook
    > application.enableevents = false
    > set wkbk = workbooks.open(...)
    > application.enableevents = true
    >
    > And if you do anything to the workbook, turn off events before you do it.
    >
    > Wouldn't that be the equivalent of disabling macros???
    >
    >
    >
    > Remy wrote:
    > >
    > > Hey
    > > Is there a way to switch off macros when you open a workbook with Excel
    > > 2000 via Automation?
    > > I know there is the
    > > excelApp.AutomationSecurity =
    > > soAutomationSecurity.msoAutomationSecurityForceDisable;
    > > in Excel 2003, but that is not around for 2000 yet.
    > > Also, setting
    > > EnableEvents = false
    > > is not working either. Seems to be a bug according to MS.
    > >
    > > Thanks
    > >
    > > Remy Blaettler
    > > www.collaboral.com

    >
    > --
    >
    > Dave Peterson




  4. #4
    Dave Peterson
    Guest

    Re: Disable Macros when loading a Workbook in Excel 2000

    I remember skimming by that thread. Thanks for the solution (I'll speak for the
    OP!).

    Tom Ogilvy wrote:
    >
    > Dave, I think he has tried that and is making reference to this article:
    >
    > http://support.microsoft.com/default...b;en-us;211626
    > XL2000: EnableEvents Property Does Not Work in Automation Server
    >
    > So the solution for that case is a macro run from within Excel that disables
    > events. How that is implemented by the OP is their decision.
    >
    > --
    > Regards,
    > Tom Ogilvy
    >
    > "Dave Peterson" <[email protected]> wrote in message
    > news:[email protected]...
    > > Can you open the workbooks after you disable events:
    > >
    > > dim wkbk as workbook
    > > application.enableevents = false
    > > set wkbk = workbooks.open(...)
    > > application.enableevents = true
    > >
    > > And if you do anything to the workbook, turn off events before you do it.
    > >
    > > Wouldn't that be the equivalent of disabling macros???
    > >
    > >
    > >
    > > Remy wrote:
    > > >
    > > > Hey
    > > > Is there a way to switch off macros when you open a workbook with Excel
    > > > 2000 via Automation?
    > > > I know there is the
    > > > excelApp.AutomationSecurity =
    > > > soAutomationSecurity.msoAutomationSecurityForceDisable;
    > > > in Excel 2003, but that is not around for 2000 yet.
    > > > Also, setting
    > > > EnableEvents = false
    > > > is not working either. Seems to be a bug according to MS.
    > > >
    > > > Thanks
    > > >
    > > > Remy Blaettler
    > > > www.collaboral.com

    > >
    > > --
    > >
    > > Dave Peterson


    --

    Dave Peterson

  5. #5
    Remy
    Guest

    Re: Disable Macros when loading a Workbook in Excel 2000

    The problem is that the macro is executed in the Open event in Excel,
    so until I can call a macro to switch of Macros, it's already too late.

    Remy


+ 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