Spire.XLS is a professional Excel API that enables developers to create, manage, manipulate, convert and print Excel worksheets. Get free and professional technical support for Spire.XLS for .NET, Java, Android, C++, Python.

Fri Dec 09, 2016 8:06 am

Hi

I scearch to evaluate Conditional Formats create with Excel but i don't find ConditionalFormats.

Code: Select all
var b2 = sheet.Range["B2"];
var count = b2.ConditionalFormats.Count; // count == 0


Thanks for your help
Attachments
ConditionalFormat.rar
(6.13 KiB) Downloaded 269 times

VincentB
 
Posts: 120
Joined: Thu Sep 15, 2016 9:44 am

Mon Dec 12, 2016 2:17 am

Dear VincentB,

Thanks for your inquiry.
By investigation, I can get the ConditionalFormats in the file you provided with the latest Spire.XLS Pack Hotfix Version:7.11.13. Did you use this version ?

Sincerely,
Betsy
E-iceblue support team
Attachments
screenshot.png
screenshot.png (5.55 KiB) Viewed 2087 times
User avatar

Betsy.jiang
 
Posts: 3099
Joined: Tue Sep 06, 2016 8:30 am

Wed Dec 14, 2016 8:59 am

Hi

Indeed, when Conditional Formats is create with Excel, it works.
My sample is wrong.

I have got problem when Conditional Formats is create with Interop Excel (sample in attachment)
but i don't see any differents.

Do you reproduce issue ?

I use hotfix 7.11.13

Thanks
Attachments
ConditionalFormatInteropExcel.rar
(9.12 KiB) Downloaded 273 times

VincentB
 
Posts: 120
Joined: Thu Sep 15, 2016 9:44 am

Wed Dec 14, 2016 9:24 am

Dear VincentB,

Thanks for the information.
I have tested the new file with version 7.11.13, and I also can get the conditional format, please see the screenshot.
What is your code ?

Sincerely,
Betsy
E-iceblue support team
Attachments
Image 3.png
Image 3.png (7.19 KiB) Viewed 2076 times
User avatar

Betsy.jiang
 
Posts: 3099
Joined: Tue Sep 06, 2016 8:30 am

Mon Dec 19, 2016 9:45 am

Hi,

I understand my mistake.

Code: Select all
var c4 = sheet.Range["C4"];
var count = c4.ConditionalFormats.Count; // Count == 0

var c4e7 = sheet.Range["C4:E7"];
count = c4e7.ConditionalFormats.Count; // Count == 1


I want to know if one cell have ConditionalFormat.
I will use workbook.Worksheets[0].ConditionalFormats to find it.

Thanks

VincentB
 
Posts: 120
Joined: Thu Sep 15, 2016 9:44 am

Tue Dec 20, 2016 2:12 am

Dear VincentB,

Thanks for your feedback.
Welcome to write to us for further question, we are here for help.

Sincerely,
Betsy
E-iceblue support team
User avatar

Betsy.jiang
 
Posts: 3099
Joined: Tue Sep 06, 2016 8:30 am

Return to Spire.XLS