#1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 4
Default MS Query

I recorded a procedure that includes a query (MS Query,
Excel 2002) to an external data source. The result set is
returned to a sheet in the workbook. How do you change,
or better yet, programmatically specify, the destination
path for the result set? Right now, if I move the
workbook to another folder, the query fails.

Thanks for your help.
Tom

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 179
Default MS Query

Tom

That shouldn't happen normally. The external data source is hardcoded (full
path) into the QueryTables Connection and CommandText properties. The
destination of the result set is a Range object stored in the Destination
property. When you add a QueryTable, you use the QueryTables property of
the Worksheet object.

Sheet1.QueryTables.Add ...

So it shouldn't matter where the you run this code, it will always go to
Sheet1 of the ActiveWorkbook. Post the code that you are using and the
exact error message.

--
Dick Kusleika
MVP - Excel
www.dicks-clicks.com
Post all replies to the newsgroup.

"Tom Ulincy" wrote in message
...
I recorded a procedure that includes a query (MS Query,
Excel 2002) to an external data source. The result set is
returned to a sheet in the workbook. How do you change,
or better yet, programmatically specify, the destination
path for the result set? Right now, if I move the
workbook to another folder, the query fails.

Thanks for your help.
Tom



Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Import New Database Query (Union Query) in Spreadsheet klock Excel Discussion (Misc queries) 2 September 24th 09 01:30 AM
Convert hard coded query criteria to Parameter Query Melanie[_2_] Excel Discussion (Misc queries) 0 July 15th 08 09:59 PM
Excel 2007 / MS Query - editing existing query to another sheet Hotpepperz Excel Discussion (Misc queries) 0 June 13th 08 06:53 PM
Importing Data via Web Query - Can values be passed to query? [email protected] Excel Discussion (Misc queries) 5 May 9th 06 06:21 PM
Microsoft Query rejects "nz" function in Access Query Vaughan Excel Discussion (Misc queries) 0 May 4th 05 05:20 PM


All times are GMT +1. The time now is 08:00 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"