PDA

View Full Version : Application.Screenupdating = False Not Working In Workbooks().Activate In Windows 8



XRRACER111
01-04-2014, 02:00 AM
I have VBA code that works under windows 7 and excel 2013. It sets application.screenupdating to false just before every windows (filename).activate function. When I tried the same code on excel 2013, but Windows 8 the application.screenupdating = false stopped working only on the Windows or workbooks activate functions. I have tried the following currentflag = application.screenupdating and currentflag shows false. I tried debug.print application.screenupdating and it showed true in the debugger. To make sure that each change was not effected by the debugger. I turned off the debugger and tried the same code and it flickers between the books. Any ideas?

Excel Fox
01-04-2014, 03:18 PM
Application.ScreenUpdating will always show True in the debug window. But that shouldn't alter the way it works when a routine / function is run. To evaluate this better, can you post a sample file which replicates the scenarios you explained above?

Excel Fox
01-04-2014, 03:21 PM
In addition, if the workbooks are in the same instance, then try using Workbooks().Activate instead of Windows().Activate.

XRRACER111
01-06-2014, 09:59 PM
In addition, if the workbooks are in the same instance, then try using Workbooks().Activate instead of Windows().Activate.

I already tried using Workbooks versus Windows and there was no difference, however the instance idea is interesting. How do I open 2 workbooks in separate instances versus the same instance. How will I know which mode I am in?

Excel Fox
01-06-2014, 11:22 PM
You can open another instance of Excel just how you would open the first instance.

Regarding the code itself, what exactly are you trying to do? Can you post a sample file, and show us what the issue is?

XRRACER111
01-07-2014, 02:00 AM
I found the problem. Windows 8 treats changing instances diferently than Windows 7 and XP. Office 2010 require different file open to create different instances. It's native mode was open in the same instance. Office 2013 forces each workbook into it's own instance. However Windows 8 treats switching instances diferently. Windows 8 ignores the screenupdating = false when it goes between instances. How do I force office 2013 to start a workbook in the current instance?