Weird error

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I am getting the following error and I have no clue why:
Compiler error: Variable not defined

The error is showing up on:
Option Explicit
ScreenUpdating = False
(rest of the code deleted...)

What's the deal?

Thanks in advance,
Brad K
 
Brad K...
I am getting the following error and I have no clue why:
Compiler error: Variable not defined

The error is showing up on:
Option Explicit
ScreenUpdating = False
(rest of the code deleted...)

What's the deal?

Thanks in advance,
Brad K

Hi Brad,

Wild guess...

Option Explicit

Sub WildThang()

Application.ScreenUpdating = False

Rest of your code...


End Sub
 
Brad,

You need to add "Application.(dot)" before S"creenUpdating = False"
See
Application.ScreenUpdating = False

And the code should be placed inside of a Sub like this.

Sub Test()
Application.ScreenUpdating = False
'Your Code Here
End Sub
 
Thanks all for the help. This did the trick.
Out of curiousity, why does one need to put "Application." in this instance.
Thanks,
Brad
 
Hi Brad

don't know for sure (someone else around here probably will), but i'm
guessing that as you have Option Explicit you're making not only variable
declarations required but also ensuring that the objects are specified for
the methods or properties and not leaving it "to chance" (although help
doesn't say this!)

Regards
julieD
 
ScreenUpdating is a property of the Application object, not the
workbook.
The Application has other properties such as Calculation etc.

Press F2 while in the VBE and you can browse the Application's
Properties and Methods

Tim
 

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

Back
Top