If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below. |
|
|
Thread Tools | Display Modes |
#1
|
|||
|
|||
Charts not up-to-date in PowerPoint
I have a C# app which updates the datasheet of charts in a PowerPoint
presentation. I am calling Application.Update() and Application.Quit() after setting data sheet cells. Sporadically, the resulting chart viewed from PowerPoint is not up-to-date. If I double-click on the chart in PowerPoint, it rerenders correctly. My impression is that rerendering the chart is going on asynchronously as I modify the data sheet and if the calls to Update() and Quit() occur too soon, the chart is left in a partially rendered state. I have tried calling Chart.Refresh() prior to Application.Update(), but it doesn't seem to help. I'd really like to avoid putting a random wait into my code. Does anyone know of a deterministic way to force MSGraph to finish rendering or to block until it has finished rendering? Some additional info: Occasionally and unpredictably Application.DataSheet fails. I could really use some help here. The documentation and online resources are pretty sparse. Thanks, Mike |
#2
|
|||
|
|||
Hi Mike -
There is a little information about MS Graph, some on the MS site, and some at http://pptfaq.com. Unfortunately it's all VBA-based, and I don't know any C# to speak of. The thing is, you have to get the MS Graph OLE Object to update. I rarely use MS Graph, so I don't offhand know what the required code is. If you search the support and msdn subdomains of microsoft.com, and check out the PowerPoint faq site, you'll see the VBA commands, and that might be enough to help you figure out the C# equivalents. - Jon ------- Jon Peltier, Microsoft Excel MVP Peltier Technical Services Tutorials and Custom Solutions http://PeltierTech.com/ _______ Mike Abraham wrote: I have a C# app which updates the datasheet of charts in a PowerPoint presentation. I am calling Application.Update() and Application.Quit() after setting data sheet cells. Sporadically, the resulting chart viewed from PowerPoint is not up-to-date. If I double-click on the chart in PowerPoint, it rerenders correctly. My impression is that rerendering the chart is going on asynchronously as I modify the data sheet and if the calls to Update() and Quit() occur too soon, the chart is left in a partially rendered state. I have tried calling Chart.Refresh() prior to Application.Update(), but it doesn't seem to help. I'd really like to avoid putting a random wait into my code. Does anyone know of a deterministic way to force MSGraph to finish rendering or to block until it has finished rendering? Some additional info: Occasionally and unpredictably Application.DataSheet fails. I could really use some help here. The documentation and online resources are pretty sparse. Thanks, Mike |
#3
|
|||
|
|||
Jon:
I have searched high and low for a couple of months, and have found no documentation or discussion of the asynchronous (apparently) rendering performed by MSGraph. The problem is not getting the OLE object updated in PowerPoint - there is a lot of discussion about the need to call MSGraph's Update() method to ensure that changes get passed back to the hosting app. The problem is that MSGraph is rendering the chart asynchronously (I think), and that when I call Update() the rendering is not yet complete. For example, if my C# code adds 4 series to the chart, I may see only 3 of them when I first open PowerPoint. If I then double-click on the chart to activate MSGraph, the fourth series magically appears. Mike "Jon Peltier" wrote: Hi Mike - There is a little information about MS Graph, some on the MS site, and some at http://pptfaq.com. Unfortunately it's all VBA-based, and I don't know any C# to speak of. The thing is, you have to get the MS Graph OLE Object to update. I rarely use MS Graph, so I don't offhand know what the required code is. If you search the support and msdn subdomains of microsoft.com, and check out the PowerPoint faq site, you'll see the VBA commands, and that might be enough to help you figure out the C# equivalents. - Jon ------- Jon Peltier, Microsoft Excel MVP Peltier Technical Services Tutorials and Custom Solutions http://PeltierTech.com/ _______ Mike Abraham wrote: I have a C# app which updates the datasheet of charts in a PowerPoint presentation. I am calling Application.Update() and Application.Quit() after setting data sheet cells. Sporadically, the resulting chart viewed from PowerPoint is not up-to-date. If I double-click on the chart in PowerPoint, it rerenders correctly. My impression is that rerendering the chart is going on asynchronously as I modify the data sheet and if the calls to Update() and Quit() occur too soon, the chart is left in a partially rendered state. I have tried calling Chart.Refresh() prior to Application.Update(), but it doesn't seem to help. I'd really like to avoid putting a random wait into my code. Does anyone know of a deterministic way to force MSGraph to finish rendering or to block until it has finished rendering? Some additional info: Occasionally and unpredictably Application.DataSheet fails. I could really use some help here. The documentation and online resources are pretty sparse. Thanks, Mike |
#4
|
|||
|
|||
Mike -
As I said, I rarely use MS Graph, and mostly as a curiosity. I wonder if you activate the OLE Object in code whether it will be the same as double clicking it manually. This might be the DoVerb method of the OLE Object, if memory serves. We're leaving the realm of my understanding, unfortunately. - Jon ------- Jon Peltier, Microsoft Excel MVP Peltier Technical Services Tutorials and Custom Solutions http://PeltierTech.com/ _______ Mike Abraham wrote: Jon: I have searched high and low for a couple of months, and have found no documentation or discussion of the asynchronous (apparently) rendering performed by MSGraph. The problem is not getting the OLE object updated in PowerPoint - there is a lot of discussion about the need to call MSGraph's Update() method to ensure that changes get passed back to the hosting app. The problem is that MSGraph is rendering the chart asynchronously (I think), and that when I call Update() the rendering is not yet complete. For example, if my C# code adds 4 series to the chart, I may see only 3 of them when I first open PowerPoint. If I then double-click on the chart to activate MSGraph, the fourth series magically appears. Mike "Jon Peltier" wrote: Hi Mike - There is a little information about MS Graph, some on the MS site, and some at http://pptfaq.com. Unfortunately it's all VBA-based, and I don't know any C# to speak of. The thing is, you have to get the MS Graph OLE Object to update. I rarely use MS Graph, so I don't offhand know what the required code is. If you search the support and msdn subdomains of microsoft.com, and check out the PowerPoint faq site, you'll see the VBA commands, and that might be enough to help you figure out the C# equivalents. - Jon ------- Jon Peltier, Microsoft Excel MVP Peltier Technical Services Tutorials and Custom Solutions http://PeltierTech.com/ _______ Mike Abraham wrote: I have a C# app which updates the datasheet of charts in a PowerPoint presentation. I am calling Application.Update() and Application.Quit() after setting data sheet cells. Sporadically, the resulting chart viewed from PowerPoint is not up-to-date. If I double-click on the chart in PowerPoint, it rerenders correctly. My impression is that rerendering the chart is going on asynchronously as I modify the data sheet and if the calls to Update() and Quit() occur too soon, the chart is left in a partially rendered state. I have tried calling Chart.Refresh() prior to Application.Update(), but it doesn't seem to help. I'd really like to avoid putting a random wait into my code. Does anyone know of a deterministic way to force MSGraph to finish rendering or to block until it has finished rendering? Some additional info: Occasionally and unpredictably Application.DataSheet fails. I could really use some help here. The documentation and online resources are pretty sparse. Thanks, Mike |
Thread Tools | |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Aggregating Date Data into Weeks and Quarters | Roger | Running & Setting Up Queries | 3 | July 11th, 2004 05:56 PM |
If statement | Doug | Worksheet Functions | 9 | June 28th, 2004 06:13 AM |
PowerPoint: hide slide by date | Beena | Powerpoint | 1 | June 14th, 2004 04:21 PM |
Powerpoint Org Charts created in 2000 now using 2003 | Brian | Powerpoint | 2 | May 23rd, 2004 07:14 PM |
Help! Chart losing date format | Jon Peltier | Charts and Charting | 0 | February 12th, 2004 10:34 PM |