using Excel = Microsoft.Office.Interop.Excel; Microsoft.Office.Interop.Excel.Application xlApp = new Microsoft.Office.Interop.Excel.Application(); if (xlApp == null) { Console.WriteLine("EXCEL could not be started. Check that your office installation and project references are correct."); return; } string Password = "myPassword"; string Password_Unprotect = "UnProtectNow"; xlApp.DisplayAlerts = false; xlApp.Visible = false; Excel.Workbook wbk = xlApp.Workbooks.Open(@"D:\MyWorkbook.xlsb", 0, false, 5, Password, "", false, Excel.XlPlatform.xlWindows, "", true, false, 0, true, false, false); wbk.Password = Password; wbk.Unprotect(Password_Unprotect);
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)