Sign In  Sign Up Live-Chat

Cannot add Excel file as OLE object

Last post 05-17-2008, 12:43 PM by msfaiz. 2 replies.
Sort Posts: Previous Next
  •  05-15-2008, 12:58 PM 127274

    Cannot add Excel file as OLE object

    Attachment: Present (inaccessible)

    Adding the attached file to a presentation using the sample code in the first example (link below) does not produce any compile-time or run-time errors.

    But once you open the generated .ppt file in powerpoint (Office 2003) and click on the Object Changed message, you get an error message.

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

     
  •  05-16-2008, 3:10 AM 127389 in reply to 127274

    Re: Cannot add Excel file as OLE object

    Dear larsxe,

    Thanks for reporting.

    We will investigate and provide you a solution as soon as possible.


    Many Thanks and Kind Regards,

    Shakeel Faiz
    Support Engineer
    Aspose Tyumen Team
     
  •  05-17-2008, 12:43 PM 127536 in reply to 127274

    Re: Cannot add Excel file as OLE object

    Attachment: Present (inaccessible)

    Dear larsxe.

     

    I found out there is some problem with your source Excel sheet. I saved it back using File -- > Save As … menu command in MS Excel 2002.

     

    Then I inserted it with the follow code and it did not show the message on double clicking the Object Changed image, which it was giving earlier.

     

    Please see the generated ppt and source excel sheet in the attachment.

     

    C#

    -----------------------------------------------------------------------

    //Instantiate a Presentation object that represents a PPT file

    Presentation pres = new Presentation();

    //Accessing a slide using its slide position

    Slide slide = pres.GetSlideByPosition(1);

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

    FileStream fin = new FileStream(@"c:\-workbook1.xls", FileMode.Open, FileAccess.Read);

    byte[] xlSheetData = new byte[fin.Length];

    fin.Read(xlSheetData, 0, (int)fin.Length);

    //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", xlSheetData);

    //Writing the presentation as a PPT file

    pres.Write("C:\\output.ppt");


    Many Thanks and Kind Regards,

    Shakeel Faiz
    Support Engineer
    Aspose Tyumen Team
     
View as RSS news feed in XML