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

Free Support Forum - aspose.com

Can we have a value in a hidden field while creating an excel

Hi,

I am have a requirement to set a hidden value in an excel which can be used later to uniquely identify the excel while using it some other systems. Can we set a hidden value in an excel and read it later in an excel using Aspose.Cells

Thanks

Hemangajit

Hi Hemangajit,

Thank you for considering Aspose.

If your requirement is to Hide/Unhind the Rows and columns then you can
implement this functionality by using Cells.HideRow(RowIndex) and
Cells.HideColumn(ColumnIndex) functions.Following code will help you
better understand the implementation of the functionality

Sample Code:<?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" />


//Instantiating a Workbook object
Workbook workbook = new Workbook();
//Opening the Excel file through the file stream
workbook.Open("C:\\book1.xls");
//Accessing the first worksheet in the Excel file
Worksheet worksheet = workbook.Worksheets[0];
//Hiding the 3rd row of the worksheet
worksheet.Cells.HideRow(2);
//Hiding the 2nd column of the worksheet
worksheet.Cells.HideColumn(1);
//Saving the modified Excel file in default (that is Excel 2003) format
workbook.Save("C:\\output.xls",FileFormatType.Default);

You can also see the details of hiding / unhiding of rows and columns from documentation

link as follow:

http://www.aspose.com/documentation/file-format-components/aspose.cells-for-.net-and-java/hidingunhiding-rows-and-columns.html

Thank you & Best Regards,

Thanks Nausherwan, your suggestion fulfilled my requirements.



Regards

Hemangajit