View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Tim Williams Tim Williams is offline
external usenet poster
 
Posts: 1,588
Default Programmatically finding out if Excel macros are enabled.

Have you added a reference to the VBE library?
What is the text of the error you get?

Tim

--
Tim Williams
Palo Alto, CA


"Zhwgnon Flrq" <Zhwgnon wrote in message
...
How can I find out through VB 6.0 whether macros are enable in an Excel

2003
application?

I tried the following but it does not work:

Set ea = CreateObject ("Excel.Application")

' test.xls has macros
Set wb = ea.Workbooks.Open ("e:\test.xls")

' This line bombs out
MsgBox (ea.VBE.VBProjects.Count)

Any help will be appreciated. Thanks.