Code covered by the BSD License  

Highlights from
Unprotect Excel sheet

Unprotect Excel sheet

by

 

unprotecting a password protected sheet in excel, function requires a password to do that.

test1()
function test1()
%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']);
ProtecStatus2(Excel, 'rasam1');

Contact us