Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
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
Posted to microsoft.public.excel.programming
|
|||
|
|||
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
Posted to microsoft.public.excel.programming
|
|||
|
|||
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 |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Excel macro to open a password protected workbook | Excel Discussion (Misc queries) | |||
Excel 2007 - Encrypted and password protected Workbook | New Users to Excel | |||
password protected workbook | Excel Worksheet Functions | |||
Make Workbook Password protected tp open | Excel Discussion (Misc queries) | |||
Multiple workbook user's with Master workbook - all password protected | Excel Discussion (Misc queries) |