Click here to Skip to main content
15,897,371 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
Hi All,

I am using ClosedXML for my application.I used the following codes to write some values into the existing worksheet.
XLWorkbook tasklog = new XLWorkbook("TaskLogTemplate.xlsx");

IXLWorksheet Ws = tasklog.Worksheet(sheetName);
                Ws.Cell(1,3).Value = "ProjectName";
                Ws.Cell(2,3).Value = "LogTitle";
                Ws.Cell(3,3).Value = "ModelHead";
                Ws.Cell(2,5).Value = "PHead";
                tasklog.Save();

But it removes the formatting of adjacent cells such as border style, color etc.
Can anyone help me. I tried search in ClosedXML forums but no solutions found....
Thanks in Advance.
Posted
Updated 21-Jul-20 11:16am
Comments
Maciej Los 21-Nov-14 2:31am    
You need to open TaskLogTemplate rather than create another one!
Manu Prasad 21-Nov-14 3:00am    
What is the syntax for that?
Manu Prasad 21-Nov-14 3:28am    
I think there is no method for open a workbook in ClosedXml..
BillWoodruff 21-Nov-14 4:54am    
In addition to taking Maciej's advice, why don't you ask a question on the Discussion section of the project:

https://closedxml.codeplex.com/discussions
Member 14895510 21-Jul-20 18:36pm    
Did you ever find a solution to the issue of formatting getting cleared / changed? Still appears to be a bug in v0.95

1 solution

Please, read my comment to the question.

I'd suggest to read the documentation: https://closedxml.codeplex.com/documentation[^]
 
Share this answer
 
Comments
Manu Prasad 21-Nov-14 3:18am    
Help me please ,how can I open An Excel in ClosedXml (Syntax???)?

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900