Embedding Excel sheet into word

I been using ASPOSE to embed XLS OLE objects into Slide. Now my next task is to do the same with word. I see the announcement for this support back in April of this year in the 14.3 release.
But I like to request to see some examples how I can take XLSX sheet and embed each sheet into a word doc. Keep in mind that I like to embed the OLE so the object is editable.
Once the object is complete, I like to send the word to the end user.

Hi Jeremy,

Thanks for your inquiry. Please refer to the “DocumentBuilder.insertOleObject Method Added to the Public API” section in Public API Changes in Aspose.Words 14.3.0 page. I hope, this helps.

Best regards,

Thanks for reply Awais,

My problem is reading from existing Excel Workbook (ASPOSE) and supplying it via builder.insertOleObject method which its looking for inputstream. Can you tell me how I can take an Excel Workbook and choose a sheet (#3) and insert it via OLE (editable) word doc?

I am not sure if we can read existing workbook and be able to choose the excel tab to insert via the insertOleObject method.

Additionally, I want to confirm that if insertOleObject will not embed just the object file but to full display the excel object inside the word doc and not as attachment. It is viewable\editable within the word doc that opens. If insertOleObject is not option what is?

I also saw this… Convert xlsx to docx. Is this the only option?


Hi Jeremy,
Yes, you are right. The post you mentioned is the only option to convert Excel workbooks to Word documents. You can try any of those options and let us know if you see any issue.
Best Regards,

The solution does not work from the link Convert xlsx to docx I posted earlier. I need this for Java not .net. Do you have a java solution?
The XLS to PDF to Word is something discussed. But will the formatting of the PDF to word lost? Font/cell color/charts? I need the word doc to look 95% what XLS have been generated and its editable.

Does ASPOSE don’t have solution for embedding Excel Sheet in to word (not as attachment but a viewable cell block in word)?

Please confirm, we just purchase the Aspose.total suite and feeling misinterpreted on this capability. The XLS to PPT works well but to word is severally lacking. We may have to resort to Apache POI (open source) library to do this conversion, but prefer to stay with ASPOSE as single library.

Please advice urgently!

Please see the attached screen shot of example of what I am looking for. The spreadsheet font\formating\color and any embedded images within XLS will need to also be able to embed into the word doc.

If the above is truly not supported. How about converting ASPOSE.excel into HTML and from HTML back to word. Does it support all of the formatting? Please provide example of any recommendations.

Thank you!!!


Hi Jeremy,
Can you please share a sample Excel document you want to convert to Word? We will test the quality of the output against your documents and share more details with you. Sorry for the inconvenience.
Best Regards,

Dear Muhammad,

Please see attached XLS file. Please share your export/embed into word doc. Between each sheet a page break is required.


Hi Jeremy,
We are working on this and will get back to your shortly.
Best Regards,

Hi Jeremy,
I converted your Excel file to PDF using latest version of Aspose.Cells and then PDF to Word using Aspose.Pdf, and output looks fine. Can you please test at your end and let us know if it is fine for you using the latest versions?
Best Regards,

Can this be done without converting into PDF. My firm doesn’t have aspose PDF license. I am able to insert a excel into word as icon by the following code:

string oWordTemplate = sTemplatePath.TrimEnd();
asWord = new Document(oWordTemplate);
DocumentBuilder asBuilder = new DocumentBuilder(asWord);
var asShape = asBuilder.InsertOleObject(sExcelFile, true, true, null);

or even by

Stream memStream = File.OpenRead(sExcelFile);
var asShape = asBuilder.InsertOleObject(memStream,"Excel.Sheet.8",true,null);

But as soon as I turn the isIcon flag false, the doc becomes empty. The mentioned file has only one sheet and also I have attached the desired result word doc.

Hi Jeremy,

Thanks for your inquiry. Aspose.Cells supports converting Excel worksheets to images. A simple solution would be to just convert Worksheet to image and then use that preview image in DocumentBuilder.InsertOleObject method as follows:

Document doc = new Document();
DocumentBuilder builder = new DocumentBuilder(doc);
Stream memoryStream = File.OpenRead(MyDir + "Worksheet in Test.xls");
Shape oleObject = builder.InsertOleObject(memoryStream, "Excel.Sheet.8", false, Image.FromFile(MyDir + "SheetImage.jpg"));
doc.Save(MyDir + @"out.docx");

Hope, this helps.

Best regards,