Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Using ADODB to read data out of another excel file

I am using ADODB to read data out of another excel file.
Sometime the line "oConn.Open XLFile" actually causes
excel to "OPEN" the referenced document - when it is
soposed to just open it as a data source.
I am using the microsoft example source code (see below)
for doing this. This issue is not consistantly re-
produceable.

Any Ideas?

-Chris
(code follows)

Dim XLFile As String
XLFile = "\\fls02\apps\available Packages.xls"
Dim oConn As New ADODB.Connection
oConn.Provider = "Microsoft.Jet.OLEDB.4.0"
oConn.Properties("Extended Properties").Value = "Excel
8.0;ReadOnly=True;FirstRowHasNames=False;HDR=NO"
oConn.Open XLFile


  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 459
Default Using ADODB to read data out of another excel file

If the connection remains open the workbook will be locked and can't
be opened, so ensure you are closing your connection with oConn.Close.
Is this the behavior you are getting or is the workbook opening
'visibly'?

--

"Chris Edwards" wrote in message ...
I am using ADODB to read data out of another excel file.
Sometime the line "oConn.Open XLFile" actually causes
excel to "OPEN" the referenced document - when it is
soposed to just open it as a data source.
I am using the microsoft example source code (see below)
for doing this. This issue is not consistantly re-
produceable.

Any Ideas?

-Chris
(code follows)

Dim XLFile As String
XLFile = "\\fls02\apps\available Packages.xls"
Dim oConn As New ADODB.Connection
oConn.Provider = "Microsoft.Jet.OLEDB.4.0"
oConn.Properties("Extended Properties").Value = "Excel
8.0;ReadOnly=True;FirstRowHasNames=False;HDR=NO"
oConn.Open XLFile

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 244
Default Using ADODB to read data out of another excel file

I do close the connection when I am done using it.
The workbook opens "visibly"(and I have it isolated to
that one individual line).. Which confuses me as it is a
declared object (Dim oConn As New ADODB.Connection) and
should in no way open the file..

-Chris

-----Original Message-----
If the connection remains open the workbook will be

locked and can't
be opened, so ensure you are closing your connection with

oConn.Close.
Is this the behavior you are getting or is the workbook

opening
'visibly'?

--

"Chris Edwards"

wrote in message news:<017101c3c004$a0c7b2b0
...
I am using ADODB to read data out of another excel

file.
Sometime the line "oConn.Open XLFile" actually causes
excel to "OPEN" the referenced document - when it is
soposed to just open it as a data source.
I am using the microsoft example source code (see

below)
for doing this. This issue is not consistantly re-
produceable.

Any Ideas?

-Chris
(code follows)

Dim XLFile As String
XLFile = "\\fls02\apps\available Packages.xls"
Dim oConn As New ADODB.Connection
oConn.Provider = "Microsoft.Jet.OLEDB.4.0"
oConn.Properties("Extended Properties").Value = "Excel
8.0;ReadOnly=True;FirstRowHasNames=False;HDR=NO"
oConn.Open XLFile

.

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
access database (adodb)from excel vba AskExcel Excel Worksheet Functions 0 July 17th 06 02:01 AM
Read data from anohter XLS file John Whitehead via OfficeKB.com Excel Worksheet Functions 6 July 31st 05 10:20 PM
Read data from ascii file Nazrul Excel Programming 2 October 23rd 03 08:21 PM
VBA to read data from XL and import into another XL file Steve D[_4_] Excel Programming 0 August 28th 03 04:34 PM
Selective read data from ascii file Steve Kim Excel Programming 0 August 20th 03 05:19 AM


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

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"