Excel 2007 data connection

F

FS

I have a data connection in an Excel 2007 workbook that works no problems.
How do I change just the command text property in VBA?
I've found instructions that look similar to
Sheet1.QueryTables(1).CommandText = but when I try Query tables it gives me
an error and I've done a count of the query tables and it is 0.
My connection is to a SQL server not a web query so I don't think
QueryTables is in the right direction.

Thanks
 

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