Use workbook name in Connection

  • Thread starter Thread starter James_G
  • Start date Start date
J

James_G

Hello,

How do I find the name of the active workbook and use it in the following
connection string? I have tried several different things and nothing seems
to be working....i believe I have been looking at it for too long now. Any
ideas?


Private Const glob_s_Connect = "Driver={Microsoft Excel Driver (*.xls)}
;DriverId=790;Dbq=" & path_to_open_file & ";DefaultDir=C:\GelcoData;"
 
'ActiveWorkbook.Name' w/o the quotes gives its name.

But I'm confused. Are you trying to connect from an
application outside Excel, e.g. Access? If not, why
do you need a connection?

Hth,
Merjet
 
merjet said:
'ActiveWorkbook.Name' w/o the quotes gives its name.

But I'm confused. Are you trying to connect from an
application outside Excel, e.g. Access? If not, why
do you need a connection?

Hth,
Merjet

I am using ADO to take data from one sheet and join it with another sheet and
then dump it all into another sheet. If the data was joined already, we
wouldn't be talking. They don't want to use Access or SQL Server. They want
Excel. Kinda sucks for me, but anyway......is that enough help?
 
Back
Top