Senin, 19 Januari 2015

[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 (1)
----------------------------------
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