Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2
Default Open a password protected excel workbook from second workbook to fetch data using dynamic connection

Hi,

I have two excel applications. I wish to fetch data from excel application A
to excel application B using recordsets. My excel application A is password
protected. How do I fetch the data without actually opening application A
(using recordsets in excel application B).

Any help is most welcome.

Thanks,

Kaustav


  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 8
Default Open a password protected excel workbook from second workbook to fetch data using dynamic connection

I have done something like you with ADODB

In the Reference add : "Microsoft ActiveX Data Objects 2.5 Library
In your function of B add :
Dim cntXLSFile As ADODB.Connectio
Dim rstQuery As ADODB.Recordse
Dim strTmp As Strin

'sets the ODBC driver to read the Excel file (without opening it
Set cntXLSFile = New ADODB.Connectio
cntXLSFile.ConnectionString = "DRIVER={Microsoft Excel Driver (*.xls)};ReadOnly=0;DBQ=" & [The Full File Name of A
'opens a connection to the Excel fil
cntXLSFile.Ope

'gets the marketing organisation, exercise year and report type from the FMRG templat
Set rstQuery = cntXLSFile.Execute("SELECT * FROM [The Named Range];"
If Not rstQuery is Nothing The
If Not rstQuery.EOF The
rstQuery.MoveFirs
strTmp = rstQuery.Fields("[The Field Name]").Valu
rstQuery.Clos
Set rstQuery = Nothin
End I
cntXLSFile.Clos
Set cntXLSFile = Nothin

To use it you must organize your data as follo
first row : list of the fields name (1 field by column [The Field Name]
and the data belo
A named range must be defined for the data including the field's name row ([The Named Range])

I hope this will help you
NicoB

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2
Default Open a password protected excel workbook from second workbook to fetch data using dynamic connection

Hi NicoB,

I have done something very similar to what you have proposed. My problem
is that my first application from where I plan to fetch the data is
password protected. When I supply the password in the connection string
it displays an error like "Runtime Error-'2147217843(8004e4d)' Cannot
start your application. The workgroup information file is missing or
opened exclusively by another user." (The application is closed
actually) and when I dont it displays an error like "Runtime
Error-'2147467259(80004005)' could not decrypt file. ".

How do I fetch data from the application now. Hope I have made myself
clear on the issue.

Thanks for showing interest.

Kaustav

*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!
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
Excel macro to open a password protected workbook Stephen C Excel Discussion (Misc queries) 8 December 1st 08 05:36 AM
Excel 2007 - Encrypted and password protected Workbook Ron New Users to Excel 0 August 7th 08 08:21 PM
password protected workbook Ann Excel Worksheet Functions 4 July 10th 08 10:47 PM
Make Workbook Password protected tp open Stockwell43 Excel Discussion (Misc queries) 4 July 2nd 08 12:44 AM
Multiple workbook user's with Master workbook - all password protected Yvon Excel Discussion (Misc queries) 2 March 30th 05 01:34 PM


All times are GMT +1. The time now is 04:37 PM.

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

About Us

"It's about Microsoft Excel"