locked
Updating a Powerpoint shape in slideshow mode RRS feed

  • Question

  • Powerpoint 2007, Windows 7

    Hi.

    I have a problem with MS Graph to refresh after updating data in the datasheet in a Powerpoint 2007 slideshow. It is not a problem in a Powerpoint 2010 slideshow and it was not a problem in Powerpoint 2003. I'm trying to force it to refresh by using the following codeline directly on the object.

                oChart.Application.Update()

    and this on the slideshow object

                myShape.ZOrder(Microsoft.Office.Core.MsoZOrderCmd.msoSendBackward)

    where myShape is holding the Chart object to try to force it to refresh

    I can see that it is refreshed in the design mode but not in the slideshow mode

    Someone - any ide how to force Powerpoint the refresh the MSGraph object at runtime?

    Sveinung Flaathen


    SF
    Thursday, January 27, 2011 9:42 PM

Answers

  • Hi Sveinung,

    There is a KnowledgeBase article that discusses updting the graph from an Excel data range without displaying the workbook in PowerPoint. You'd have to transform the code from VBA (in Excel) to Visual Basic.NET, but the approach should work since the objects - Ezcel and PowerPoint with embedded MSGraph - are essentially the same. The article is:
    267974 GRAPH2000: VBA: How to Paste New Excel Data into an Existing Graph
    http://support.microsoft.com/default.aspx?scid=kb;EN-US;267974

    If you need to work with a Microsoft Support Engineer, because of its complexity your question falls into the paid support category which requires a more in-depth level of support.  Please visit the below link to see the various paid support options that are available to better meet your needs. http://support.microsoft.com/default.aspx?id=fh;en-us;offerprophone

    • Marked as answer by Jennifer Zhan Tuesday, February 8, 2011 5:20 AM
    Wednesday, February 2, 2011 6:07 PM

All replies

  • Hi Sveinung Flaathen

    When you add a chart to a PowerPoint 2007 slide the default is a 'chart' object which is not MsGraph. Using Office 2007 Enterprise version 12.0.6424.1000 I couldn't reproduce your problem. Both the datasheet (an Excel object) and the slide are visible in PowerPoint design mode. Changing the values in the datasheet causes the chart to reflect the change immediately. No code is required to see the new graphic when moving to SlideShow mode.

    There are some content sources that you may find useful. See - "Automate Office PowerPoint 2007 with Visual Basic 2005"
    http://msdn.microsoft.com/en-us/library/bb871574(VS.80).aspx

    The document contains the following
    "Office Excel has automation support for creating charts. You can create a chart in Office Excel; set up its data, properties, and layout; and then copy it into an Office PowerPoint slide. The code to do this is straightforward, but quite lengthy. See the code in the sample to see how this is done.

    "There are a couple of limitations to this approach:

    "Both Office PowerPoint and Office Excel need to be visible during the entire process, because the process activates and selects objects in order to control the copy/paste operation.

    "The chart is copied as a Picture, meaning that it will break its link to the underlying data and cannot be edited after it is added to the Office PowerPoint slide."

    Also see this forum thread-
    Convert Type "Shape" To "Chart"
    http://social.msdn.microsoft.com/Forums/en-US/vsto/thread/1de48b51-a35c-4057-a9c9-39812fb34607/

    If none of the above provides a solution for your problem you might post a reply stating how to use a MsGraph chart instead of a PowerPoint 2007 chart object, and include more information to allow the volunteers who browse this forum to reproduce your experience.

    Regards

    Tuesday, February 1, 2011 3:13 PM
  • Hi Cjatms

    Thanks for the answer.

    I a'm aware of the new graph object in Offece 2007/2010 and are using it (trying to). The reason why I would like to use the MS Graph object is two sided 1; to avoid the excel worksheet to flash the screen while updating the graph with incoming data 2; I find the MS Graph object less fragile. I'm developing an Audience Respose System and are collecting votes while in slideshow mode and would like to update the graph accordingly. This worked fine in Office 2003 and is working fine in 2010, with MS Graph object, but not in 2007 (Well it is working sometimes, but not every time - pretty anoying). I have customers using Office 2007 who are experiencing this problem.

    I guess the link belove is describing the same problem, bet the solution is not good enough.

    http://www.pptalchemy.co.uk/PowerPoint_Screen_Refresh.html

     

    By the way - I'm not to happy with the way the new graph object works. It seems to me that the integration is fragile. Every now and then Powerpoint or Excel brakes down. So if someone has a "waterproof" way of handling the new graph object at runtime in a Powerpoint slideshow I would appreciate code samles. 

    I'm using VisualStudio 2008 - Visual Basic - and VSTO tecknology for creating Office addins.

     

    Let's hope all customers are using Office 2010 very soon :-)

    SF


    SF
    Tuesday, February 1, 2011 5:43 PM
  • Hi Sveinung,

    There is a KnowledgeBase article that discusses updting the graph from an Excel data range without displaying the workbook in PowerPoint. You'd have to transform the code from VBA (in Excel) to Visual Basic.NET, but the approach should work since the objects - Ezcel and PowerPoint with embedded MSGraph - are essentially the same. The article is:
    267974 GRAPH2000: VBA: How to Paste New Excel Data into an Existing Graph
    http://support.microsoft.com/default.aspx?scid=kb;EN-US;267974

    If you need to work with a Microsoft Support Engineer, because of its complexity your question falls into the paid support category which requires a more in-depth level of support.  Please visit the below link to see the various paid support options that are available to better meet your needs. http://support.microsoft.com/default.aspx?id=fh;en-us;offerprophone

    • Marked as answer by Jennifer Zhan Tuesday, February 8, 2011 5:20 AM
    Wednesday, February 2, 2011 6:07 PM
  • Hi again cjatms

    Thanks for your efforts. I will look into the paid support categories.

     

    SF


    SF
    • Proposed as answer by cjatms Thursday, February 10, 2011 7:00 PM
    Tuesday, February 8, 2011 8:32 AM
  • Hello Sveinung Flaathen, We are facing the same issue, If you know the solution could you text me. Thanks a lot. Thanks, Vivekanandan
    Tuesday, March 15, 2011 9:32 PM
  • Hi Vivekanandan.

    I have not found a satisfying solution for Powerpoint 2007, but in Powerpoint 2010 Microsoft have obviously corrected this becaurse I have not the same problems in 2010.


    SF
    Wednesday, March 16, 2011 8:01 AM
  • Hi again!

    If you are refering to the problems with the new graph object I have not found a waterproof solution to that either although clearing the GarbageCollection twice in the Finally part of the Try like this: 

                    GC.Collect()
                    GC.WaitForPendingFinalizers()

                    GC.Collect()
                    GC.WaitForPendingFinalizers()
    seems to help.

    I'm using the "old" MS Graph object which I think works much better.

    Hope this was helpful :-)

     

    Sveinung


    SF
    Wednesday, March 16, 2011 8:09 AM
  • Dear Sir,

    Can you please share some code here to update an existing chart (like with the old ms graph object).

    I can't find out how you get this to work in 2010 without excel flashing up.

     

    thanks.

    Friday, August 26, 2011 4:19 PM