Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 158
Default Edit Microsoft Query

Paul,

Try something like this...

Save your MS Query as an .dqy file. You do this in MS Query wizard panels.
1. On the "Query Wizard - Finish" panel, select the "Save Query" Button.
2. This will save the active query to your c:\documents and settings\[your
name here]\application data\microsoft\queries directory.
3. Right click on the .dqy file (to edit, if you double click it will open
and refresh the data) and Edit with Notepad
4. Within the .dqy you will see the full connection string to your database
-- modify as appropriate
5. Within the .dqy you will see the SQL stmt - modify as appropriate
6. Save .dqy using naming convention (so when it comes time to use, you know
which one).
7. Now instead of trying to modify MS Query with VBA, just write VBA to open
the appro. .dqy (see how it automatically refreshes when it opens?).

Can you take it from there?

--
Thx
MSweetG222



"Paul Grayson" wrote:

Hi,

Please can someone helpme with this. I have a pivot table that pulls data
from sql server and I will need to point the pivot data to different tables
depending on what results I want to see. How can I do this quickly through
code or a macro so it takes me straight to Microsoft Query so i can point the
pivot at another data source.

I have tried recording a macro to do this but it does not work.

Thanks

Paul

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
Edit with Microsoft Query - Menu Choice is gone Mike Setting up and Configuration of Excel 0 May 12th 10 05:03 PM
Edit with Microsoft Query - Menu Option Mike Excel Discussion (Misc queries) 0 May 12th 10 04:34 PM
where to reset microsoft query allow edit command DDE SSDLUE Setting up and Configuration of Excel 0 January 26th 07 10:47 PM
Microsoft Query rejects "nz" function in Access Query Vaughan Excel Discussion (Misc queries) 0 May 4th 05 05:20 PM
Edit Query from Excel will not open query in MSQuery Michelle Excel Programming 0 February 21st 05 03:59 PM


All times are GMT +1. The time now is 11:23 AM.

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

About Us

"It's about Microsoft Excel"