Excel ClosedXML ProtectedView

SSinhg 286 Reputation points
2024-01-17T20:15:36.6433333+00:00

Hi I have a requirement where in need to read excel from a location and update its certain cells and then save it to different location.I wrote a code snippet using ClosedXML

using (var workbook = new XLWorkbook(excelFilePath))
 {     foreach (var worksheet in workbook.Worksheets)  
   {         // Your code to work with each worksheet goes here         // ...     }  
    // Save the workbook if needed     workbook.SaveAs(excelFilePath); 
}

Challenge - if the excel is in protectedMode nothing works... (Open Source - ClosedXML) Any help can get me going... Thnaks

C#
C#
An object-oriented and type-safe programming language that has its roots in the C family of languages and includes support for component-oriented programming.
10,574 questions
Office Development
Office Development
Office: A suite of Microsoft productivity software that supports common business tasks, including word processing, email, presentations, and data management and analysis.Development: The process of researching, productizing, and refining new or existing technologies.
3,684 questions
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. Carlos dos Santos 85 Reputation points
    2024-01-24T00:25:12.4166667+00:00

    Hi @SSinhg There is an article about this here: https://docs.closedxml.io/en/latest/features/protect.html

    0 comments No comments