JW,
You can have VBA automatically add 'Option Explicit' to all new
code modules. In VBA, go to the Tools menu, choose Options,
Editor tab, and check "Require Variable Declaration".
--
Cordially,
Chip Pearson
Microsoft MVP - Excel
Pearson Software Consulting, LLC
www.cpearson.com
"JW" wrote in message
...
"keepITcool" wrote:
JW:
Let me add some background to Chip's reply..
You probably do not use
Option Explicit
if variables do not need to be declared then using s'th like
AnyOddConstant will just return an Empty Variant
(unless ofcourse you or a referenced library has defined the
constant)
so:
in your project you must set a reference to:
Microsoft Office 10.0 Object Library (version may be
different)
and:
it's VERY good practive to ALWAYS use Option Explicit
to force this:
in the VBE =
= Tools Options
= Require Variable Declaration CHECK
Thanks for your suggestions, which indeed worked. When using
VB, I always set
Option Explicit. Guess I'm lazier when it comes to VBA &
Vbscript. Learned my
lesson.
jon
--