Copying excel worksheet to word

hi

Is it possible to copy the contents of a excel along with the format to word (not an image it should be editable) maybe as a table on the word.

I have explored the option of reading data and creating table but I want to know if aspose has the option of directly copying the worksheet as table on the word.

please let me know.

Hi Sarah,

Thanks for your inquiry.

First of all, please note that Microsoft Word and Microsoft Excel documents are completely different file formats; so, some features that are available in Microsoft Word are not available in Microsoft Excel and vice versa and it is hard to convert from Word to Excel and from Excel to Word with 100% fidelity.

Unfortunately, there is no direct way to convert Excel document to Word. However, it is possible using Aspose.Words and Aspose.Cells. Please use the attached utility to convert Excel document to Word document. Hope this helps you.

ConverterXls2Doc converterXls2Doc = new ConverterXls2Doc(MyDir + "Aspose.Words.xlsx", true, "Arial", "10");
converterXls2Doc.convert(false);
Document convertedWordDoc = converterXls2Doc.getDocument();
convertedWordDoc.save(MyDir + "Out.docx");

hi

Thanks for sharing the code .
It did work for me I was able to copy .
but i get a message in the document and the formatting like the header color is lost
Is it possible to retain the formatting ??

Evaluation Only. Created with Aspose.Words. Copyright 2003-2016 Aspose Pty Ltd.

Also, the license is collective for aspose words and cells or seperate for each?

Hi Sarah,

Thanks for your inquiry. Please note that in evaluation mode there are some limitations applied. E.g. Aspose.Words injects an evaluation watermark at the top of the document. The document’s contents are truncated after a certain number of paragraphs during import or export.

Please request for 30-days temporary license from here:
Get temporary license

Please refer to the following article about applying license.
Applying a License

Regarding formatting issue, please share your input Excel document and output Word document here for testing? We will investigate the issue on our side and provide you more information.