We're sorry Aspose doesn't work properply without JavaScript enabled.

Free Support Forum - aspose.com

What is the best practice to extract Excel tables/ranges/cellarea and import into Word?

We have a requirement to extract excel ranges (or cell area) and insert them with their excel styling into a Word document. Currently we are just exporting the range as HTML and then importing that into Word. We have a bunch of these to perform per document so optimizing the move is important.

Is this the best way to accomplish this task or is there a better way (faster, simpler, or more consistent) to accomplish this?

@mitchhayes,

Thanks for your query.

I think you are doing ok, this is better approach. Another approach can be save ranges to PDF via Aspose.Cells and then PDF pages to Word document via Aspose.Words or Aspose.PDF.

By the way, Aspose.Cells now supports Excel to DOCX feature, so may be you could try to use it for your requirements.

Thanks so much for your quick response. We have had good results with HTML but the import isn’t very fast. The Excel to Docx feature looks intriguing because it is similar to the approach we use moving certain word document assets from one document to another. However, something we would need is a DocxSaveOption.setExportArea() so that we would just save the range we need. Worse case we could create a new, temporary worksheet and copy the source range there for saving to docx. This sounds like an option we should explore.

@mitchhayes,

The Excel to DOCX feature is relatively new and we will enhance it to accommodate other options which might take time.

Yes, this option can be tested if it works for your needs.

It seems the performance issue is in HTML to DOCX via Aspose.Words. We appreciate if you could share resource files and provide sample code to mimic the issue. We will check your issue soon.

Thanks for your feedback. We look forward to additional Docx save features.

I’m in the middle of some other Aspose work so I won’t be able to get back on these details until probably next week.

@mitchhayes

It would be great if you share your input HTML file for testing? You can create a separate request in Aspose.Words support forum. We will check the issue with performance and provide you more information.

Also, our sister company GroupDocs provides GroupDocs.Conversions product, which provides a functionality to convert Excel to Word.