ODBC

  • Thread starter Thread starter Jim
  • Start date Start date
J

Jim

I'm using a DSN to use data from one workbook in another.

Is it possible within VBA to open the workbook which is 'connected' to the
DSN.

So the DSN 'Test2' connects to c:\data\interesting.xls. I connect to this by
using the SQL.CONNECT formula. I want to add a button to the sheet that
will allow users to open the source workbook 'interesting.xls'. This is
where I'm stuck.

Any thoughts??

Regards. Jim
 
You should be able to open the workbook even if it's connected through
ODBC -

As to how to do it, why not use a hyperlink? Draw a 'button' on the
sheet and hyperlink it to the other file.

As far as I know, to do this in VBA requires Windows API calls, which
I would rather not get into here. You may want to look in the VBA
help under the GetObject function; they have a great example there.
Save everything (in all applications) before playing with any of that
code! One of the drawbacks to API calls is that little mistakes can
cause big problems. Another drawback is that your file may be tagged
as a virus by your virus scanner.

-Mike


I'm using a DSN to use data from one workbook in another.

Is it possible within VBA to open the workbook which is 'connected' to the
DSN.

So the DSN 'Test2' connects to c:\data\interesting.xls. I connect to this by
using the SQL.CONNECT formula. I want to add a button to the sheet that
will allow users to open the source workbook 'interesting.xls'. This is
where I'm stuck.

Any thoughts??

Regards. Jim

Mike Argy
Custom Office Solutions
and Windows/UNIX applications

Please post on-topic responses to the newsgroup

To e-mail me, remove nospam from the address in the headers
 

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

Back
Top