Sign UpSign Up   Sign InSign In Welcome Guest,
Live Chat Live Chat

Excel Chart Embed In PPTX

Last post 07-05-2009, 11:33 PM by mshakeel.faiz. 3 replies.
Sort Posts: Previous Next
  •  06-25-2009, 1:51 PM 185512

    Excel Chart Embed In PPTX

    Hi there,

      I was wondering how the code in the following forum be translated into PPTX namespace? Because I noticed that FindShape doesn't exist in PPTX namespace. Can you translate the code below into PPTX namespace?

     

    http://www.aspose.com/documentation/file-format-components/aspose.slides-for-.net-and-java/working-with-ole-object-frames.html

     

     

    Thanks


    This message was posted using Page2Forum from Working with OLE Object Frames - Aspose.Slides for .NET and Java
     
  •  06-26-2009, 6:45 AM 185606 in reply to 185512

    Re: Excel Chart Embed In PPTX

    Hello,

    It is not possible to set alternative text for OLE objects in PowerPoint 2007 so the only simple solution is iterate all shapes and find shape with OleObjectFrameEx type.

    foreach (ShapeEx shape in shapes)
    {
        if (shape is OleObjectFrameEx)
        {
            ...
        }
    }

    It's also possible to search shapes using Tags but they can be created and accessed in PowerPoint through VBA only.

    Alexey Zhilin
    Team Leader
    Aspose Tyumen Team
    About Us
    Contact Us
     
  •  07-02-2009, 2:32 PM 186643 in reply to 185606

    Re: Excel Chart Embed In PPTX

    Hi there,

      I'm now trying to embed an existing chart in excel into blank powerpoint slide using the example below but what I get is "Embedded OLE Object" written on the slide where the chart is supposed to be. What am I doing wrong? Thanks for your help:

    'Instantiate a Presentation object that represents a PPT file

    Dim pres As Presentation = New Presentation("C:\\demo.ppt")

     

     

    'Accessing a slide using its slide position

    Dim slide As Slide = pres.GetSlideByPosition(2)

     

     

    'Reading excel chart from the excel file and save as an array of bytes

    Dim fstro As FileStream = New FileStream("C:\\excel1.xls", FileMode.Open, FileAccess.Read)

    Dim b() As Byte = New Byte(fstro.Length) {}

    fstro.Read(b, 0, CType(fstro.Length, Integer))

     

     

    'Inserting the excel chart as new OleObjectFrame to a slide

    OleObjectFrame oof = slide.Shapes.AddOleObjectFrame(0,0,pres.SlideSize.Width,

                    pres.SlideSize.Height,"Excel.Sheet.8", b)

     

     

    'Writing the presentation as a PPT file

    pres.Write("C:\\modified.ppt")

     
  •  07-05-2009, 11:33 PM 186953 in reply to 186643

    Re: Excel Chart Embed In PPTX

    Please read about Object Changed Issue When Adding OleObjectFrame

     

    You can solve this problem by inserting your own image. Please see this example where a chart was created and its image was taken using Aspose.Cells and then that was used to replace the object change image.

     

    Creating Excel chart and embedding them as OLE Object inside a Presentation


    Many Thanks and Kind Regards,

    Shakeel Faiz
    Support Developer
    Aspose Sialkot Team
    Contact Us
    Aspose - The .NET and Java Component Publisher

    Keep in touch! We're on Twitter and Facebook
     
View as RSS news feed in XML