If the file is a valid zip file (the first few bytes are 50 4B
-- used in formats like .xlsm
), then unzip the file and look for the subfile xl/vbaProject.bin
. This is a CFB file just like the .xls
files. Follow the instructions for the XLS format (applied to the subfile) and then just zip the contents.
For the XLS format, you can follow some of the other methods in this post. I personally prefer searching for the DPB=
block and replacing the text
CMG="..."
DPB="..."
GC="..."
with blank spaces. This obviates CFB container size issues.