Asking users to Enable Macro's

  • Thread starter Thread starter f1capsicum
  • Start date Start date
F

f1capsicum

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?
 
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"
 
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.
 
f1capsicum

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

ex.visible = true
ex.AutomationSecurity = msoAutomationSecurityByUI

DM Unseen
 
Back
Top