LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Using ADO to read from ActiveWorkbook

Hi all

I have an Excel file and I am reading data from the ActiveWorkbook. I am
using the below code to create a ADODB connection.

Dim dt As New ADODB.Connection

With dt
.Provider = "Microsoft.Jet.OLEDB.4.0"
.ConnectionString = "Data Source=" & ThisWorkbook.Path & "\" &
ThisWorkbook.Name
.Properties("Extended Properties") = "Excel 8.0;HDR=Yes"
.Open
End With

The issue is that if I open firstly a blank Excel file, and then I open my
Excel file (with the above code) , when executing the €ś.Open€ť instruction,
Excel opens a new instance of my Excel file. This issue decreases the
performance of the Excel application, and provoke bad results.

How can i fix this issue? I am using an ADODB connection because I need to
run a query against Excel and then save data to a local DB.

Thank.
 
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
ActiveWorkbook.RefreshAll Matt Cromer[_2_] Excel Programming 3 July 24th 06 08:45 PM
ActiveWorkbook.RefreshAll nc Excel Discussion (Misc queries) 0 March 21st 06 10:50 AM
ActiveWorkBook Pete Excel Discussion (Misc queries) 3 May 9th 05 04:14 PM
ThisWorkbook vs. ActiveWorkbook? JK Excel Programming 5 April 19th 05 07:54 AM
ActiveWorkbook.RefreshAll toosie Excel Programming 1 February 16th 05 09:55 AM


All times are GMT +1. The time now is 02:54 PM.

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"