昨天拿到一个xlsm文件,模板写的有点问题,打算修改下凑合用,然而发现工程有密码保护,于是Google一番,发现这个回答挺靠谱,完美解决:
https://stackoverflow.com/a/31073075/6001263
粘一下步骤:
- Change the extension of the
.xlsm
file to.zip
. - Open the .zip file (with WinZip or WinRar etc) and go to the xl folder.
- Extract the
vbaProject.bin
file and open it in a Hex Editor. - Search for
DPB
and replace withDPx
and save the file. - Replace the old
vbaProject.bin
file with this new on in the zipped file. - Change the file extension back to
.xlsm
. - Open workbook skip through the warning messages.
- Open up Visual Basic inside Excel.
- Go to Tools > VBAProject Properties > Protection Tab.
- Put in a new password and save the
.xlsm
file. - Close and re open and your new password will work.