VB and Option Explicit

R

Russ

Trying to run a macro to export hierarchy to Excel. I
keep getting a VB error saying that Option Explicit is a
syntax error. I seem to remember running into this
before, but never resolved the issue. Anyone else run
into this?

Thanks

Russ
 
J

JackD

Are you by any chance running a macro which was downloaded from my site
(http://masasmiki.com/project)?
If so the problem is not in the option explicit line, it is in the line
beginning with attribute.

Comment that out using an apostrophe ' and it will run fine.

-Jack
 
M

Mark Durrenberger

fyi "Option explicit" tells the VB complier that all variables must be
declared before use (explicit declaration) - it is an enourmous help to
those of us who write code because it virtually eliminates variable name
typos like

dim blnOpen as boolean

bln0pen = True ' this will puke the compliler if "option explicit"

Mark

--
_________________________________________________________
Mark Durrenberger, PMP
Principal, Oak Associates, Inc, www.oakinc.com
"Advancing the Theory and Practice of Project Management"
________________________________________________________

The nicest thing about NOT planning is that failure
comes as a complete surprise and is not preceded by
a period of worry and depression.

- Sir John Harvey-Jones
 

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