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

c++ - OpenCV Error: Assertion failed <scn == 3 ::scn == 4> in unknown function, -

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

The canvas has been tainted by cross-origin data in chrome only -