Option Explicit Statement

H

hermie

When I run the performance analyzer I get in idea tip to use an Option
Explicit Statement
1 What is an Option Explicit Statement
2 Where can I see / find this

Herman
 
K

Ken Snell [MVP]

Option Explicit is a statement that goes at the top of a module in the
Declarations section. It will cause the compiler to raise errors if your
code uses variables that are not defined in Dim or Const or Public or
Private statements. Helps you to avoid typos in variable names.

It's explained in Help file. You can have all new modules always include
this statement if you open Visual Basic Editor, click Tools | Options, and
select the "require variable declaration" checkbox.
 
K

Kevin Sprinkel

Option Explicit is a VBA statement used at the module
level. It must appear before any procedures. Its
presence requires that all variables be declared and
typed. The man advantage of using it is that the compiler
can then find any variable-name typos in the body of your
code.

HTH
Kevin Sprinkel
 

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