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: 3
Default ADODB Connection in Same Excel File

Hi All,
I m using Excel 10.0 (Office XP SP3).

The scenario out with me is that a Visual Basic Exe Generates an Excel File.
This Excel file (Will refer this Final Report further).
This final report will we used by the End User. Know this final report
contains a Sheet (let suppose €śSheet1€ť will be hidden sheet) this sheet
contains Data in a Simple Table format (like a Sql Server has). As this is a
stand alone file, that will contains macros and some buttons to initiate the
macro in the Visual Basic Editor, for all other process. I want to open a
connection within the same Excel file. Then the records can be fetched by
using recordset for various calculations like (percentage, average)

I cant use the Excel formula in this process

I have used the following code for opening a connection where
strDBPath =€ť C:\DATA\Automation\Excel Tool\Test.xls€ť

Sub OpenExcelDatabase(strDBPath As String)
Dim cnnDB As New ADODB.Connection

With cnnDB
.Provider = "Microsoft.Jet.OLEDB.4.0"
.Properties("Extended Properties") = "Excel 8.0"
.Open strDBPath
End With
End Sub

This Code used some other Excel file (Test.xls). But over here my
requirement is to open the connection with same Excel file with a Different
Sheet (€śSheet1€ť)

Please any one can tell me what I need to pass while opening the Connection

 
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
ADODB Connection fi.or.jp.de Excel Worksheet Functions 0 September 9th 09 09:23 PM
ADODB.Connection Bogdan Excel Programming 7 July 16th 07 03:42 PM
VBA excel - problem with having clause in sql with adodb.connection/recordset ukp9999 Excel Programming 3 November 21st 05 07:48 AM
share adodb connection in excel Marek Excel Programming 3 September 7th 04 08:56 AM
Virus - importing excel via adodb connection Jim M[_4_] Excel Programming 1 May 15th 04 08:09 AM


All times are GMT +1. The time now is 06:25 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"