Calculate number of words

Hi,

I need to get number of words, contained in my xls sheet.
How can I do it ?

Thanks,
Roman

Hi,


I am not sure about your need, could you elaborate if more? Also, how you can do this in MS Excel, you may provide some screen shots or template Excel file. Moreover, Do you need to count number of cells which contains data, if this is the case, you may use Count attribute of the Cells class.

Thank you.

I develop application that converts user uploaded xlsx documents into xps.

Since conversion of xlsx document, that contains huge amount of text data (I’m talking about ~20mb of text) can be real performance hit to application, I am going to reject such documents.

To identify those, I want to calculate total number of words/characters. Maybe calculating number of characters would be better. So, how can I achieve my goal ?

Thanks,
Roman

Hi,


Aspose.Cells does support to convert to XPS files directly, so you may try using the feature, see the document for your reference:
http://docs.aspose.com/display/cellsnet/Converting+to+XPS


Note: Even you may think about converting your selective range of cells in the worksheet to XPS (see the above document SheerRender.ToImage() method for reference. To make your desired range, you can specify the printable area using PageSetup options, see the document (you may try using to set printable area accordingly:
http://docs.aspose.com/display/cellsnet/Setting+Print+Options
Sample code:
//Instantiating a Workbook object
Workbook workbook = new Workbook();

//Obtaining the reference of the PageSetup of the worksheet
PageSetup pageSetup = workbook.Worksheets[0].PageSetup;

//Specifying the cells range (from A1 cell to G35 cell) of the print area
pageSetup.PrintArea = “A1:G35”;





If you still find the performance issue, kindly share your template xlsx file here, we will check it soon.
Also, We recommend you to kindly try our latest fix: Aspose.Cells for .NET v7.1.2.2


Thank you.