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: 4
Default vb and excel as datasource

here is my code below everything goes well until

Set rst = oConn.Execute(strSQL)

it says it cant find the object 29-Dec-2003 (this is the worksheet
name for sure)
I have tried this with the sheet named ws1 and without the a2:5000
any ideas whats going on?

Private Sub Form_Load()
Dim rst As ADODB.Recordset
Dim oConn As ADODB.Connection
Set oConn = CreateObject("ADODB.Connection")
MsgBox App.Path & "\caretaker.xls"
strSQL = "SELECT * FROM [29-Dec-2003$a2:G500]"
oConn.Open "Driver={Microsoft Excel Driver (*.xls)};DriverId=790;Dbq="
& App.Path & "\caretaker.xls;DefaultDir=" & App.Path
Set rst = oConn.Execute(strSQL)
 
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
Pivot Table from External Datasource of Excel Workbook Fowmy New Users to Excel 0 December 2nd 08 12:03 PM
How do I change the datasource location for a query in Excel 2003 StormKatt Excel Discussion (Misc queries) 1 March 2nd 07 03:10 AM
Security for Viewing MS Access Databases From Excel Datasource Sam Wardill Excel Discussion (Misc queries) 0 March 28th 06 03:47 PM
Web form validation using Excel datasource? arubyan Excel Programming 0 May 22nd 04 01:57 AM
Excel column as datasource Harish S Excel Programming 2 February 10th 04 01:48 PM


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