LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5
Default Pointing to a new data source

I just solved this for myself.

Open the worksheet and place the cursor on a cell within the cell range of
the query. Press Alt-F11 to open the VBEditor. Press Ctrl-G to open the
Intermediate window. Type the command: ? ActiveCell.QueryTable.Connection.
The embedded connection string will be echoed back to the screen. Put double
quotes around the string and update the connection information with the new
server info. Move the cursor to the beginning of the connection string and
insert the folling in front of the string:

ActiveCell.QueryTable.Connection =

Move the cursor to the end of the string and press enter. This will store
the updated connection string back into the worksheet. Try your query now.

Repeat for any other embedded queries in your worksheet.

"Cameron" wrote:

Well, when I press the buttons they open asking to connect to the database
and then request the username and password. But I can't seem to find in the
code where you could hard code those responces. The box that pops up has the
old database in it.

There are a number of macros that run but even in them I do not see the ODBC
connection string.

"Matt" wrote:

It depends on how the buttons call the data. You need to investigate
the document and see if those buttons call Macros, and if so then you
can modify the Macro to point to the new SQL path


 
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
Pointing Finger Mouse Gaffnr Excel Worksheet Functions 1 June 8th 09 12:47 PM
display data in stock chart by pointing cursor Shawn Charts and Charting in Excel 1 March 3rd 08 01:09 AM
pointing to the c:\ drive Cockneygeordie Excel Discussion (Misc queries) 0 July 5th 06 03:34 PM
Pivot Table data source "data source contains no visible tables" Jane Excel Worksheet Functions 0 September 29th 05 08:28 PM
How can i set the source-data-range of pivottable2 to the source . Piet Excel Discussion (Misc queries) 0 March 5th 05 09:31 PM


All times are GMT +1. The time now is 10:01 PM.

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"