PM33830 Macro function TM1RECALC1: ScreenUpdating handling

Post bug reports and the status of reported bugs
Post Reply
Ben Stremme
Posts: 5
Joined: Tue Mar 02, 2010 7:33 pm
OLAP Product: TM1
Version: 9.5.2 FP1
Excel Version: 2003 + 2010

PM33830 Macro function TM1RECALC1: ScreenUpdating handling

Post by Ben Stremme »

Problem description

We are about to update from TM1 9.1.2 to 9.5.2.
While testing our own xls-reports (with macros, Excel 2003) we see unusual screen flickering while macro execution.
Everytime

Code: Select all

Application.Run("TM1RECALC1")
is used the property "Application.ScreenUpdating" seems to be set to true in the background.

Since we have elaborate macros with a couple of TM1RECALCs in a row. Our TM1 users don't tolerate the flickering while macro execution. After revising the code by adding

Code: Select all

Application.Screenupdating = False 
after each "Application.Run("TM1RECALC1")" we reduce screen flickering. But the screen still refreshes after each recalc.

Is there a way to undo / deactivate the command "Application.ScreenUpdating = True" in the tm1p.xla (Version 9.5.2, 32-bit)?
This command must have been added after TM1 9.1.2. In this version there is no flickering. To prevent excel from screen updating it used to be sufficient to set "Application.Screenupdating" at the beginning and at the end of a Sub.

Using

Code: Select all

Application.Visible = False / True
instead of "Application.ScreenUpdating" at the beginning and at the end (un)hides the Excel window. This is as well very irritating for users.

I found PM33830 during a web search and informed our TM1 consultants to contact the IBM support regarding this open support case. A VBA or Excel workaround would also be appreciated.

Business impact
Without removing "Application.Screenupdating = True" in tm1p.xla or an adequate workaround, we must postpone the TM1 9.5.2 update.

Thank you for any hint.
lotsaram
MVP
Posts: 3652
Joined: Fri Mar 13, 2009 11:14 am
OLAP Product: TableManager1
Version: PA 2.0.x
Excel Version: Office 365
Location: Switzerland

Re: PM33830 Macro function TM1RECALC1: ScreenUpdating handli

Post by lotsaram »

We are about to commence testing on 9.5.2 but have also found the screen flickering when updating workbooks that contain multiple active forms to be a huge user annoyance issue as the TM1Refresh macro seems to always set screenupdating to true.

The only solution we have found is quite an elaborate workaround but it seems to work quite well from a user acceptance point of view. Where a central macro is controlling workbook updating we have a hidden sheet which contains a drawing object sized to fit the screen which just contains a plain background and the text "Report refresh in progress, please wait ...". Immediatelly before the refresh is triggered screen updating is set to false and the "please wait picture" is copied to A1 on each sheet in the workbook, then then the screen is updated then set back to false. After this the refresh/recalc is called. At the conclusion all the pictures are deleted.

This way if the code in the tm1p.xla modules change the screenupdating and cause screen flickering then the user doesn't notice as all sheets contain the same please wait picture so this is not noticed. Also because the sheets are all a picture with a blank background the more impatient users are less inclined to wildly click about the screen while the macro is running which can frequently cause issues in code execution. The solution may seem clunky (and it is) but it works!
User avatar
Steve Vincent
Site Admin
Posts: 1054
Joined: Mon May 12, 2008 8:33 am
OLAP Product: TM1
Version: 10.2.2 FP1
Excel Version: 2010
Location: UK

Re: PM33830 Macro function TM1RECALC1: ScreenUpdating handli

Post by Steve Vincent »

Glad it's not just me but it has other impacts too. Not only does it hack users off (epilipsy anyone?) but it dramatically slows multiple report creation down. Many of the things i have developed use a template report, feed data in, recalc, filter then save as before going to the next selection of data. In some cases a 15s refresh is now taking 30s simply due to the screen refresh issue. Multiply that by 250 reports and you get a serious degradation in performance which the users use as a complaint against us.

I like the idea of a picture holding page but does that solve the speed issue? Whats the latest on the PMR?
If this were a dictatorship, it would be a heck of a lot easier, just so long as I'm the dictator.
Production: Planning Analytics 64 bit 2.0.5, Windows 2016 Server. Excel 2016, IE11 for t'internet
Ben Stremme
Posts: 5
Joined: Tue Mar 02, 2010 7:33 pm
OLAP Product: TM1
Version: 9.5.2 FP1
Excel Version: 2003 + 2010

Re: PM33830 Macro function TM1RECALC1: ScreenUpdating handli

Post by Ben Stremme »

I just implemented lotsarams proposal. Even though the "please wait shape" is displayed, the screen still flickers during the execution of "TM1RECALC". For some instants you still see the sheet changing to the original report surface and back.

The speed issue isn't solved by that workaround. Though the refresh performance isn't much slower through the flickering. A reference macro which took 15s to execute before the update now takes 17s.
moby91
MVP
Posts: 227
Joined: Fri Mar 11, 2011 2:18 pm
OLAP Product: TM1
Version: 9.5.1
Excel Version: 2003 2007

Re: PM33830 Macro function TM1RECALC1: ScreenUpdating handli

Post by moby91 »

Are you using an english version of Excel 2003 ?
Or are you using some localized non-english version of Excel 2003 ?
Ben Stremme
Posts: 5
Joined: Tue Mar 02, 2010 7:33 pm
OLAP Product: TM1
Version: 9.5.2 FP1
Excel Version: 2003 + 2010

Re: PM33830 Macro function TM1RECALC1: ScreenUpdating handli

Post by Ben Stremme »

We use to work with the german version. But the ScreenUpdating behavior is exactly the same when working with the english version of Excel.
The problems I'm facing are definitely caused by the source code in tm1p.xla.
IBM considers the removing of "Application.ScreenUpdating = True" at the end of the TM1RECALC/TM1RECALC1 macro in tm1p.xla as an enhancement request and not as a bug fix.
MSidat
Community Contributor
Posts: 110
Joined: Thu Aug 26, 2010 7:41 am
OLAP Product: TM1, PA
Version: PAL 2.0.8
Excel Version: 2016
Location: North West England

Re: PM33830 Macro function TM1RECALC1: ScreenUpdating handli

Post by MSidat »

We went to 9.5.2 a few months ago and had the same issues.

We are utilising a similar technique to lotsaram but instead we have one sheet which has the processing message which is visible and every other sheet is invisible until all the calcs and reformatting etc is completed. Once completed we unhide all the sheets and hide the processing sheet. Seems to work quite well.

At the same time though we have also consciously coded the vba without any activesheet.range or .selected type methods using things like the range1.value = range2.value method instead of the copy and paste method of moving data around the screen.

Sheets seems to be much faster and user friendly.
Always Open to Opportunities
Post Reply