Does workbook contain code

P

Paul Christie

Does anyone know of a way of finding out if a workbook
has a code module without opening the workbook.

I'm writing an import process into an Access Database and
I need to check the file before I open it.

Thanks for any help.
 
C

Chip Pearson

Unfortunately, the DSOleFile.PropertyReader property HasMacros
always returns true for Excel workbooks. The only way to
determine whether a workbook has macros is to open it up and
examine the code. This can be done programmatically, but the
workbook does have to be opened.

--
Cordially,
Chip Pearson
Microsoft MVP - Excel
Pearson Software Consulting, LLC
www.cpearson.com [email protected]
 
Top