Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 226
Default ADO connection to a protected workbook?

Robert Crandal laid this down on his screen :
It turns out, the mistake was actually my own. My query string looked
like this:

szSQL = "SELECT * FROM [Sheet1$A1:A1]"

The problem was, my workbook (which is protected), did not have
any sheets named "Sheet1", which probably explains why I got the error that
said "External table was not in the expected format.". Does that sound
right?


ADO error messages aren't the most intuitive for all scenarios, which
means they can be misleading. But yes, you must specify the sheetname
that contains the data you want. This precludes then that your
workbooks containing the data should be similar in structure for
sheetnames.<g

It therefore looks like I CAN make a connection to a password protected
sheet, I just need to reference actual sheet names, haha!

My bad!



"GS" wrote in message
...
Robert Crandal submitted this idea :

I'll have to do some looking into the password protected wkb issue. I'll
post my findings...


Here's what I got back from Rob Bovey regarding the open password
protection:

<From Rob Bovey
There isn't any ADO solution for password protected workbooks unless
you
consider letting Excel open them first, which kind of defeats the
purpose of ADO even if it works technically. The contents of a password
protected workbook are encrypted by Excel and ADO has no way to decrypt
it.
</

And yes, ADO works if sheet protection is in place as that doesn't
matter because that's only for the UI.

--
Garry

Free usenet access at http://www.eternal-september.org
ClassicVB Users Regroup! comp.lang.basic.visual.misc


Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Use workbook name in Connection James_G Excel Programming 3 February 5th 08 03:14 AM
using ado db connection in different workbook RB Smissaert Excel Programming 14 November 5th 06 11:36 AM
Group, Outline, Protected Worksheets and Protected Workbook BEEJAY Excel Programming 0 February 13th 06 08:40 PM
Running a macro to protect a workbook on a already protected workbook UNprotects the workbook ?? WimR Excel Programming 9 July 25th 05 12:44 PM
Open a password protected excel workbook from second workbook to fetch data using dynamic connection kaustav choudhury Excel Programming 2 April 3rd 04 06:18 AM


All times are GMT +1. The time now is 03:02 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"