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

Free Support Forum - aspose.com

Copy Cells range and formatting to Word table

I am currently evaluating Cells and Words.

One of the tasks I need to be able toaccomplish is that of selecting an Excel range, complete with formatting, and inserting it into a Word document as a table.

Please could you point me in the right direction?

Thank you.

Hi,

Well, I am afraid, there is no direct way to convert your Excel documents into Word documents. You can take images of your worksheet and add them in your word document using Aspose.Words APIs.

Please see the following document how to convert your worksheet into image.
http://www.aspose.com/docs/display/cellsnet/Converting+Worksheet+to+Image

Alternatively, there is another approach, you can convert your Excel documents into PDF using Aspose.Cells and then convert the output PDF into Word document using Aspose.Pdf APIs. Please see the following documentation articles for your reference.
http://www.aspose.com/docs/display/cellsnet/Converting+Excel+to+PDF+Files
http://www.aspose.com/docs/display/pdfnet/Convert+PDF+file+to+DOC+or+DOCX+format

Hope, this helps a bit.

Thank you.

Hi Amjad,

Thank you for the reply.

Unfortunately, an image won't work as that won't give me an editable table.

It is rather a shame. I was hoping that seeing as the two products 'Cells' and 'Words' were both from the same company there would have been some degree of interoperbility available. For me, 90% of my report generation requires this type of operation.

Whilst searching, I did see many reference to a forum post suggesting looking at the ExCell2Word demo.

http://www.aspose.com/community/files/51/.net-components/aspose.words-for-.net/entry187174.aspx

However, this link gives me a 'Post not Found' error so I assume it has been removed for some reason.

Looks like I'll have to go back to good old fashioned Office Automation for my projects.

Hi,


Well, Aspose.Words team developed a converter (utility) using Aspose.Words and Aspose.Cells APIs. I have attached the utility project here, we suggest you to try it. Also, it is not 100% reliable and there is no warranty that it will insert data/table or spreadsheet contents with maximum accuracy regarding formattings. If you still find any issue while working/ using the utility, you may post a query into Aspose.Words forum, they will check and help you if required.

Thank you.

HiAmjad,

Many thanks for posting the converter. It certainly does most of the tasks I need to do.

I just need to modify the code to add a destination scale factor as, at present, my range gets split into two tables.

Once again, many thanks for your support.

regards

Rob

Hi Rob,

Thanks for your feedback and using Aspose.Cells.

It is good to know that your issue is resolved now. Let us know if you encounter any other issue, we will be glad to look into it and help you further.