Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.charting
|
|||
|
|||
resizing and moving chart elements
Hi All,
I am programatically creating a report which includes a number of graphs. Depending on the report the position and size of elements within the charts( ie the plot area, title and legend) may change. My problem is that if I turn screen updating off to speed up the code the charts do not update. I have searched the newsgroups and have tried calling the sub that resizes /moves the chart elements multiple times as has been suggested(Which didn't work). I have also tried running the sub after screen updating has been turned back on and this works but only for the charts visible on the screen. If I run the sub manually after the report has been written it works but I do not want to do this as the final user may not be bothered clicking two buttons to get the report. My final solution has been change the code to zoom out and scroll page by page through the report updating the visible graphs unitll all have been updated( which works but doesn't look very flash). My question: has anyone else experienced this sort of thing before and been able to solve it without turning screenupdating back on first? Apoligies for the long rambling post Any help much appreciated regards Tim |
#2
Posted to microsoft.public.excel.charting
|
|||
|
|||
resizing and moving chart elements
Tim -
This used to be an issue in Excel 97 (I had a routine that scrolled to the chart, then scrolled back), but I have not had problems since I upgraded to 2000. - Jon ------- Jon Peltier, Microsoft Excel MVP Tutorials and Custom Solutions http://PeltierTech.com _______ "Tim" wrote in message oups.com... Hi All, I am programatically creating a report which includes a number of graphs. Depending on the report the position and size of elements within the charts( ie the plot area, title and legend) may change. My problem is that if I turn screen updating off to speed up the code the charts do not update. I have searched the newsgroups and have tried calling the sub that resizes /moves the chart elements multiple times as has been suggested(Which didn't work). I have also tried running the sub after screen updating has been turned back on and this works but only for the charts visible on the screen. If I run the sub manually after the report has been written it works but I do not want to do this as the final user may not be bothered clicking two buttons to get the report. My final solution has been change the code to zoom out and scroll page by page through the report updating the visible graphs unitll all have been updated( which works but doesn't look very flash). My question: has anyone else experienced this sort of thing before and been able to solve it without turning screenupdating back on first? Apoligies for the long rambling post Any help much appreciated regards Tim |
#3
Posted to microsoft.public.excel.charting
|
|||
|
|||
resizing and moving chart elements
Thanks Jon
I am using Excel 2003 which I thought would have got rid of bugs from the 97 version, strange |
#4
Posted to microsoft.public.excel.charting
|
|||
|
|||
resizing and moving chart elements
When I reread your post, I realize there are still issues with charts and
VBA. It is hard to reliably position the plot area of a chart within the chart area. Usually it works fine, but sometimes there is a magic number of points that the .top or .left of the plotarea cannot attain, and you need to use a bunch of iteration to get as close as you can. Positioning the inner plot area can only be done indirectly by positioning the (outer) plot area while taking into account the margins required for labels and such. Supposedly using the old XLM macro commands are more reliable, but I never really learned these. Apparently the Excel designers turn off not just the screen display but calculations of where screen elements should display, when screen updating is False; especially on older computers, complicated charts can be very slow to redraw. You might avoid the need for screen updating if you sprinkle DoEvents statements within the offending code. It makes Excel go through the screen calculations without actually updating the screen. DoEvents doesn't help with the precision problem I mentioned above, but it helps with getting a freshly redrawn chart. - Jon ------- Jon Peltier, Microsoft Excel MVP Tutorials and Custom Solutions http://PeltierTech.com _______ "Tim" wrote in message oups.com... Thanks Jon I am using Excel 2003 which I thought would have got rid of bugs from the 97 version, strange |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|