Lisa, thanks very much for the suggestion! (I thought I responded yesterday, but I must not have hit 'send')
I AM using a 64-bit OS with my Excel 2013, and adding the DoEvents statement as you suggested did solve the problem.
Thanks again!
Dunbar
---In ExcelVBA@yahoogroups.com, <1z@...> wrote :
Hi Dunbar,
Are you using a 32 or 64 bit OS?
I've come across something similar.
What happens if you put a DoEvents statement between the Range statements?
Lisa
-----Original Message-----
From: h_dunbar@... [ExcelVBA] <ExcelVBA@yahoogroups.com>
To: ExcelVBA <ExcelVBA@yahoogroups.com>
Sent: Mon, Jan 19, 2015 4:08 pm
Subject: [ExcelVBA] Idiosyncrasies of VBA in Excel 2013
From: h_dunbar@... [ExcelVBA] <ExcelVBA@yahoogroups.com>
To: ExcelVBA <ExcelVBA@yahoogroups.com>
Sent: Mon, Jan 19, 2015 4:08 pm
Subject: [ExcelVBA] Idiosyncrasies of VBA in Excel 2013
I'm in the process of making sure a workbook that I developed in Excel 2003 will also work in later Excel versions. I've got three things giving me trouble in Excel 2013, even though they work fine in 2010 and earlier.
Here's the first...
I have the following code at the beginning of one of my subs, just after the variable declarations:
Application.ScreenUpdating = True
Range("SeriesAbort").Value = "Use ESC key to cancel "
Range("SeriesSimRunning").Value = "Calculation in progress"
Application.ScreenUpdating = False
...
In Excel 2003 and 2010, both cells get the new values when I run the Sub.
In 2013, only the "SeriesAbort" cell gets a new value. If I switch the order of the middle 2 lines, then only the "SeriesSimRunning" cell gets a new value.
If I step through the code, both cells get the new values. If I immediately (after those 4 lines) go to the end of the Sub, both cells will have the new values. If I reach the end of the Sub normally, both cells will have the expected values at that time.
If I delete Application.ScreenUpdating = False, then both cells get the new values.
I realize that showing here just a snippet of the total code is not optimal, but I'm hoping someone might have an idea what could cause this only in Excel 2013.
Thanks,
Dunbar
__._,_.___
Posted by: h_dunbar@hotmail.com
Reply via web post | • | Reply to sender | • | Reply to group | • | Start a New Topic | • | Messages in this topic (3) |
----------------------------------
Be sure to check out TechTrax Ezine for many, free Excel VBA articles! Go here: http://www.mousetrax.com/techtrax to enter the ezine, then search the ARCHIVES for EXCEL VBA.
----------------------------------
Visit our ExcelVBA group home page for more info and support files:
http://groups.yahoo.com/group/ExcelVBA
----------------------------------
More free tutorials and resources available at:
http://www.mousetrax.com
----------------------------------
Be sure to check out TechTrax Ezine for many, free Excel VBA articles! Go here: http://www.mousetrax.com/techtrax to enter the ezine, then search the ARCHIVES for EXCEL VBA.
----------------------------------
Visit our ExcelVBA group home page for more info and support files:
http://groups.yahoo.com/group/ExcelVBA
----------------------------------
More free tutorials and resources available at:
http://www.mousetrax.com
----------------------------------
.
__,_._,___
Tidak ada komentar:
Posting Komentar