Home |
Search |
Today's Posts |
|
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
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
Posted to microsoft.public.excel.programming
|
|||
|
|||
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 |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Import New Database Query (Union Query) in Spreadsheet | Excel Discussion (Misc queries) | |||
Convert hard coded query criteria to Parameter Query | Excel Discussion (Misc queries) | |||
Excel 2007 / MS Query - editing existing query to another sheet | Excel Discussion (Misc queries) | |||
Importing Data via Web Query - Can values be passed to query? | Excel Discussion (Misc queries) | |||
Microsoft Query rejects "nz" function in Access Query | Excel Discussion (Misc queries) |