Excel - Why do charts disappear?

Asked By septimus on 30-Apr-12 09:03 PM
I seem to have amazing disappearing Excel charts and I need to find
out how to prevent them from disappearing.

My process starts in Access. A VBA procedure in Access opens an Excel
workbook as a template in the background. Data is plugged into a
worksheet named "Data." Then Access calls a macro in the Excel
template workbook which changes SERIES formulas for four different
charts on four different worksheets. Then the program updates the
colors on the bars of the bar charts. Once that is done, Access saves
the template as a finished report and makes the workbook visible.

The problem is that when the Excel workbook becomes visible the charts
are invisible. I can find the frame of the chart but the contents are
totally blank.

However, when I close the workbook and re-open it the charts are
there, and they are perfect.

Do I need to run a VBA command like a Refresh or Requery or Repaint or
something like that to make the charts appear without having to close
and re-open the workbook?

Thanks!


Paul Robinson replied to septimus on 01-May-12 05:01 AM
Another handy line to put in when updating graphics is
DoEvents

put this in after your chart update code. Not saying it will work, but
I find it can force graphics to update more often than not.
regards
Paul
driller2 replied to septimus on 01-May-12 07:03 AM
same thing happens to my 2 linked xlsx workbooks.... (1 for chart & 1
for data).
it is like two opposite hands, one is "close" for the other to open-view
the chart..
quite intriguing..





--
driller2
septimus replied to driller2 on 02-May-12 11:34 PM
Still have not found a fix for this problem. DoEvents did not help. Any
other ideas, gang?