Open Password Protected Excel Workbook C# -


i trying open password protected excel workbook. have tried many different ways of unprotecting programatically or inputting password, yet every time program runs, m prompted input password. doing wrong?

 public class attenfile     {         private excel.application excel;         private excel.workbook wb;         private excel.worksheet worksheet;         private excel.range range;         private const  int startrow = 3;         private int row;         private static object missingvalue = system.reflection.missing.value;          public attenfile(string attenfiledir)         {             excel = new excel.application();             wb = excel.workbooks.open(attenfiledir, missingvalue, missingvalue, missingvalue, "nso" );             wb.unprotect("nso");             worksheet = (excel.worksheet) wb.sheets[1];             worksheet.unprotect("nso");             range = worksheet.usedrange;         } } 


Comments

Popular posts from this blog

php - render data via PDO::FETCH_FUNC vs loop -

javascript - Which segment of a polyline was clicked? -

c# - Avoiding duplicate methods for Task and Task<T> -