Use workbook name in Connection

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;"
 
M

merjet

'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
 
J

James_G

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?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top