View Single Post
  #4   Report Post  
Posted to microsoft.public.excel.programming
Jamie Collins Jamie Collins is offline
external usenet poster
 
Posts: 593
Default vb and excel as datasource

"rob merritt" wrote ...
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?


"Harald Staff" wrote ...

According to mr Erlandsen's page
http://www.erlandsendata.no/english/...dacimportwbado
you must use either the first worksheet or a named range.


I think Mr Erlandsen's comments are instructions on how to call his
function. It is certainly possible to query worksheets other than the
first without using a defined Name (named range).

The hyphen (-) characters in the OP's sheet name means it must be
enclosed in single quotes, including the dollar ($) sheet name
indicator character, in order to be recognized e.g.

SELECT * FROM ['29-Dec-2003$']

Jamie.

--