I found out how here:
http://datapigtechnologies.com/blog/index.php/hack-into-a-protected-excel-2007-sheet/
I converted it into a crude bash script for in case I need to do it again:
#!/bin/bash workdir=`dirname $1` filename=`readlink -f "$1"` unprotected_filname=`echo $filename | sed s/.xlsm$//`-unprotected.xlsm tmpdir='/tmp/unprotect' unzip "$filename" -d $tmpdir sheetfiles=`find $tmpdir/xl/worksheets/ -iname "*.xml"` echo $sheetfiles echo "before replacing" grep -c sheetProtection $sheetfiles sed -i 's/]*\/>//g' $sheetfiles echo "after replacing" grep -c sheetProtection $sheetfiles cd $tmpdir zip -r "$unprotected_filname" * cd - rm -rf $tmpdir
Hectic dude, but very cool!
ReplyDelete