View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
Paul Paul is offline
external usenet poster
 
Posts: 661
Default Using ADO CurrentProject in Excel

Hi All,
I could really use some help. I'm writing some VBA code in Excel and I want
to use an ADO connection to the data to populate a number of recordsets but
I'm having some trouble defining the connection. Does anyone know if there is
an Excel equivilent of Access's CurrentProject? I can define a connection to
the current database in Access like this:

Dim conGlobalConnection as new ADODB.Connection

conGlobalConnection.Open CurrentProject

This is much like DAO's Currentdb. I would like to use the same in Excel but
CurrentProject doesn't work and I can't find what it should be. I haven't
tried just using the path as I'm not sure where the SSheet will end up and so
would like to avoid declaring it that way, also I think the only time I've
tried this in the past I got read only errors.

Any help would be appreciated

Many Thanks
Paul