Jump to content

Welcome to Geeks to Go - Register now for FREE

Geeks To Go is a helpful hub, where thousands of volunteer geeks quickly serve friendly answers and support. Check out the forums and get free advice from the experts. Register now to gain access to all of our features, it's FREE and only takes one minute. Once registered and logged in, you will be able to create topics, post replies to existing threads, give reputation to your fellow members, get your own private messenger, post status updates, manage your profile and so much more.

Create Account How it Works

VBA Macros in Excel 2007

  • Please log in to reply




  • Member
  • PipPipPip
  • 335 posts
We have recently upgraded all of our workstations to Office 2007 which includes Excel and Visual Basic 6.5

I have a problem with a very short, simple piece of code which runs perfectly in certain parts of the application, but not in others.

The code in question is the command to turn on/off screen updating:

Application.ScreenUpdating = True


Application.ScreenUpdating = False

This method works fine in most parts of my code.
Where it fails is when it's part of a routine attached to the activation scetion of a form, and is called a SECOND time from the main macro. The FIRST call is made without error.

The error message I get is: Method 'ScreenUpdating' of object '_Application' failed

The form itself is running in Non Modal state

Does anyone have a clue how I can correct this error?

It didn't manifest itself at all in previous version of Excel.

Many thanks,


Edit toadd:

Stangely, when editing withing the userform, VB's predictive text actually suggests the option "ScreenUpdating" as soon as I type in application.sc - selecting the option then causes the editor to suggest True or False as alternatives.

VB seems to instinctively KNOW that what I'm typing is correct, it also passes the "Compile VBA project" test, but still throws it up as an error when run

Weird eh?

Edited by Jonesey, 17 November 2009 - 08:15 AM.

  • 0


Vino Rosso

Vino Rosso

    Visiting Staff

  • Visiting Consultant
  • 235 posts
Wouldn't be anything to do with the particular form that's active when the code is called? Perhaps different properties?

Weird... defo!
  • 0




  • Topic Starter
  • Member
  • PipPipPip
  • 335 posts
Hi Vino.

This one's got me baffled for sure.

The only temporary solution I've applied so far is to insert an On Error Resume Next statement.

The form itself only has a few lines of code, it's a progress box which shows the User exactly what's running, and the code merely switches screen updating on, repaints the form then switches screen updating off.
  • 0

Similar Topics

0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users

As Featured On:

Microsoft Yahoo BBC MSN PC Magazine Washington Post HP