+ Reply to Thread
Results 1 to 5 of 5

Asking users to Enable Macro's

  1. #1

    Asking users to Enable Macro's

    I'm trying to open an Excel spread sheet from VB. The spread sheet
    contains macro's.
    I'm using code like

    Dim ex As Excel.Application
    Set ex = New Excel.Application
    Dim wb As Excel.Workbook
    Set wb = ex.Workbooks.Open(FilePath, 1)

    The sheet opens OK but it doesn't ask if macro's should be allowed or
    not. Without macro's the rest of my solution doesn't work.

    Does anyway know how I can ensure this screen appears?


  2. #2
    STEVE BELL
    Guest

    Re: Asking users to Enable Macro's

    I use this in Excel 2000.
    It opens the workbooks and the macros can be run.
    It bypasses the macro alert dialog.

    Workbooks.Open Filename:= _
    "C:\Documents and Settings\me\My Documents\Misc\ToDoList.xls"


    --
    steveB

    Remove "AYN" from email to respond
    <[email protected]> wrote in message
    news:[email protected]...
    > I'm trying to open an Excel spread sheet from VB. The spread sheet
    > contains macro's.
    > I'm using code like
    >
    > Dim ex As Excel.Application
    > Set ex = New Excel.Application
    > Dim wb As Excel.Workbook
    > Set wb = ex.Workbooks.Open(FilePath, 1)
    >
    > The sheet opens OK but it doesn't ask if macro's should be allowed or
    > not. Without macro's the rest of my solution doesn't work.
    >
    > Does anyway know how I can ensure this screen appears?
    >




  3. #3
    spaceman33
    Guest

    Re: Asking users to Enable Macro's


    Sounds like the security settings are set to disable all macros (Low).

    Go to tools on the toolbar, Marcos and then Security.

    Then select Medium to be asked about all macros in future.
    <[email protected]> wrote in message
    news:[email protected]...
    > I'm trying to open an Excel spread sheet from VB. The spread sheet
    > contains macro's.
    > I'm using code like
    >
    > Dim ex As Excel.Application
    > Set ex = New Excel.Application
    > Dim wb As Excel.Workbook
    > Set wb = ex.Workbooks.Open(FilePath, 1)
    >
    > The sheet opens OK but it doesn't ask if macro's should be allowed or
    > not. Without macro's the rest of my solution doesn't work.
    >
    > Does anyway know how I can ensure this screen appears?
    >
    >





  4. #4
    f1capsicum
    Guest

    Re: Asking users to Enable Macro's

    Security is set to Medium.
    I don't want to bypass the macro question screen.


  5. #5
    DM Unseen
    Guest

    Re: Asking users to Enable Macro's

    f1capsicum

    before opening the workbook, this should ensure correct macro warnings:

    ex.visible = true
    ex.AutomationSecurity = msoAutomationSecurityByUI

    DM Unseen


+ 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