in reply to Problem reading a MS-excel files with embedded Macro's

Okay, you have a few other options than reading the spreadsheet directly. You can try to just strip it of the data, which shouldn't be so terrible, or you can surgically remove the macro from the file.

The best way I've found to parse through Microsoft Office files is to deal with them in their HTML exports. Microsoft has gone through a hell of a lot of trouble getting these files to preserve ALL data in their HTML format, and that includes any and all VB Macros. Therefore, you if you can export the file to html, you may be good to go.

Systematically, if you save an macro-bearing Excel file as .html, you are going to have a few files, the first being something titlename.html and then a folder anmes titlename_files in the titlename_files folder is where the gold is. There are any number of MIME encoded embedded objects in that folder. You can tell what is available by checking on in the filelist.xml file provided by the Microsoft exporter. Look for the following line.

<o:File HRef="editdata.mso"/>
(or any *.mso files). Those are ActiveMime encoded (try MIME perl modules to try and read them if you can, more likely than not, they are objectified macro files, but you may be able to unravel them from there. If you remove that line, and move the file out of that working folder, then it won't see it any more, and you'll be rid of the macro. If you reimport, and resave it, those objects will be gone.

You may be able to do that programatically on a Windows machine before dumping it over to a UNIX system. To automate the process, try checking into these ProgIDs for COM objects for Excel: This is a small cross section of my registry on a clean install of Office 2k. There are a bunch of other ProgIDs, but they don't seem relevant. This is getting slightly offtopic, but you can access Excel through Perl Via COM. Check ActiveState's documentation and Microsoft's under Office development. Fish around, and hopefully you can find the right OM calls to make your day a little easier.

--jay