View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
Robert Crandal[_2_] Robert Crandal[_2_] is offline
external usenet poster
 
Posts: 158
Default ADO connection to a protected workbook?

I am making an ADO connection to macro enabled workbooks
(i.e, workbooks of type *.xlsm). Here is my connection string example:

"Provider=Microsoft.ACE.OLEDB.12.0;Data Source=C:\data.xlsm;
Extended Properties=""Excel 12.0 Macro;HDR=NO;IMEX=1"""

So far, I have been able to make connections to very simple and basic
Excel 2007 macro files. However, when I try connecting to a workbook
that is password protected (with all sheets being password protected as
well),
then I CANNOT make a connection. I get an error message that reads
something like "Table is not in the expected format".

So, my question is, is ADO useless if the workbook is password protected?
This workbook also contains hidden sheets, so I wonder if that's the
problem?
What sort of things will prevent an ADO connection? I know I do have the
correct connection string, so something else must be wrong.

Thank you!