PC Review


Reply
Thread Tools Rate Thread

ADODB Connection in Same Excel File

 
 
Abhishake
Guest
Posts: n/a
 
      13th Feb 2008
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 can’t 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

 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
excel ADODB.connection to itself ? how? djorkaef Microsoft Excel Programming 1 26th Jul 2010 03:07 PM
Access from Excel ADODB.Connection Pictou Microsoft Excel Programming 1 5th Aug 2008 05:56 PM
Create an ADODB Connection to a dBASE 5 .dbf file =?Utf-8?B?U2FyYQ==?= Microsoft Access VBA Modules 1 12th Aug 2006 06:50 PM
share adodb connection in excel Marek Microsoft Excel Programming 3 7th Sep 2004 08:56 AM
Virus - importing excel via adodb connection Jim M Microsoft Excel Programming 1 15th May 2004 08:09 AM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 03:05 AM.