Unprotect Excel sheet
30 Sep 2011
unprotecting a password protected sheet in excel, function requires a password to do that.
%NOTE: test1.xlsx has sheets protected with two passwords:
%SHEET1, Protected with rasam1 password.
%SHEET4,5 protected with rasam password.
%the function here will unprotect the first sheet, leaves the second and 3
%rd sheet as they are not password protected but needs password for 4th
%sheet, it then uses this newly given password to unprotect sheet 5.
Excel = actxserver('Excel.Application');
Excel.visible = 1;
Woorkbooks = get( Excel, 'Workbooks' );
invoke(Woorkbooks, 'open', [pwd 'test1.xlsx']);