+ Reply to Thread
Results 1 to 7 of 7

Weird error

  1. #1
    Brad K.
    Guest

    Weird error

    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

  2. #2
    JulieD
    Guest

    Re: Weird error

    Hi Brad

    Application.ScreenUpdating = False

    will work.

    Cheers
    JulieD

    "Brad K." <BradK@discussions.microsoft.com> wrote in message
    news:DDE10552-28A1-4B28-90AF-19A53BF2E778@microsoft.com...
    >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




  3. #3
    Kevin H. Stecyk
    Guest

    Re: Weird error

    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



  4. #4
    Colo
    Guest

    Re: Weird error

    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

    --
    Regards,
    Colo
    http://www.puremis.net/excel/

    "Brad K." <BradK@discussions.microsoft.com> wrote in message
    news:DDE10552-28A1-4B28-90AF-19A53BF2E778@microsoft.com...
    > 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



  5. #5
    Brad K.
    Guest

    Re: Weird error

    Thanks all for the help. This did the trick.
    Out of curiousity, why does one need to put "Application." in this instance.
    Thanks,
    Brad

    "JulieD" wrote:

    > Hi Brad
    >
    > Application.ScreenUpdating = False
    >
    > will work.
    >
    > Cheers
    > JulieD
    >
    > "Brad K." <BradK@discussions.microsoft.com> wrote in message
    > news:DDE10552-28A1-4B28-90AF-19A53BF2E778@microsoft.com...
    > >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

    >
    >
    >


  6. #6
    JulieD
    Guest

    Re: Weird error

    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

    "Brad K." <BradK@discussions.microsoft.com> wrote in message
    news:904FB587-5CAF-4A1F-91A4-8B752A6CC211@microsoft.com...
    > Thanks all for the help. This did the trick.
    > Out of curiousity, why does one need to put "Application." in this
    > instance.
    > Thanks,
    > Brad
    >
    > "JulieD" wrote:
    >
    >> Hi Brad
    >>
    >> Application.ScreenUpdating = False
    >>
    >> will work.
    >>
    >> Cheers
    >> JulieD
    >>
    >> "Brad K." <BradK@discussions.microsoft.com> wrote in message
    >> news:DDE10552-28A1-4B28-90AF-19A53BF2E778@microsoft.com...
    >> >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

    >>
    >>
    >>




  7. #7
    Tim Williams
    Guest

    Re: Weird error

    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



    "Brad K." <BradK@discussions.microsoft.com> wrote in message
    news:904FB587-5CAF-4A1F-91A4-8B752A6CC211@microsoft.com...
    > Thanks all for the help. This did the trick.
    > Out of curiousity, why does one need to put "Application." in this
    > instance.
    > Thanks,
    > Brad
    >
    > "JulieD" wrote:
    >
    >> Hi Brad
    >>
    >> Application.ScreenUpdating = False
    >>
    >> will work.
    >>
    >> Cheers
    >> JulieD
    >>
    >> "Brad K." <BradK@discussions.microsoft.com> wrote in message
    >> news:DDE10552-28A1-4B28-90AF-19A53BF2E778@microsoft.com...
    >> >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

    >>
    >>
    >>




+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1