Keeping Conditional Format from original spreadsheet

Hi,

I'm trying to import data into a worksheet in an existing spreadsheet that contains cells with conditional formating.

My first 'proof of concept' suggests that the conditional formating isn't kept when an excel file is loaded into aspose.cells.

Is this correct?

Steve

Hi Steve,

Thank you for considering Aspose.

Aspose.Cells supports conditional formatting and it preserves the conditional formatting of a file, on opening the file with Aspose.Cells.

Please do let us know if you are facing any problem, we will be happy to help you.

You can also study about the conditional formatting from the following link,

http://www.aspose.com/documentation/file-format-components/aspose.cells-for-.net-and-java/conditional-formatting.html

Thank you & Best Regards,

Nausherwan,

A belated thank you..!

I've tried again, but still am having problems. To replicate this:

a) Create a spreadsheet. Rename the first worksheet 'test', set the formula for A2 to '=A1', and set the conditional format for A2 to 'red if greater than 0'.

b) Run the following code:

Dim appExcel As New Aspose.Cells.Workbook

appExcel.LoadData(Server.MapPath("documents") & "\template\Test.xls")

Dim oWorksheet As Aspose.Cells.Worksheet

oWorksheet = appExcel.Worksheets("test")

oWorksheet.Cells(0, 0).PutValue(1)

appExcel.Save("test.xls", Aspose.Cells.SaveType.OpenInExcel, Aspose.Cells.FileFormatType.Default, Response)

When I run this, and examine the new spreadsheet, the cell A2 is not red (or even have any conditional formatting)

Am I doing something wrong here?

Cheers,

Steve

Hi,

Thank you for considering Aspose.

Well, you are using Workbook.LoadData() to open the work book. This method only fetches the data from the workbook. No formatting will be fetched from the workbook. Please use Workbook.Open() to open the workbook with all the data and formatting.

Thank You & Best Regards,

Brill! Thanks for that.

Steve