Asking users to Enable Macro's

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?
 
S

STEVE BELL

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"
 
S

spaceman33

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.
 
F

f1capsicum

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

DM Unseen

f1capsicum

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

ex.visible = true
ex.AutomationSecurity = msoAutomationSecurityByUI

DM Unseen
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top