Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Question about: Selection.QueryTable.Refresh BackgroundQuery:=False

Status
Not open for further replies.

AT76

Technical User
Apr 14, 2005
460
US
I'm trying to debug an excel app. The place where the code fails is at: Selection.QueryTable.Refresh BackgroundQuery:=False.
After this line the code prompts a connection to an oracle server. Prompts for a password and gets stock. I'm trying to figure out what table in oracle is this app trying to access. I can't see it anywhere in the code. Any suggestions? Thanks in advance. Below is the code where it fails.

runday:
er = 2
Sheets("MDI").Select
Range("A1").Select
Selection.QueryTable.Refresh BackgroundQuery:=False
 



Hi,

On your Sheet MDI, can you edit the query? Edit the query with the Macro Recorder ON.

get into the MS Query Editor end Edit/Return Data to Excel.

Turn off the recorder and observe your code.

BTW, AVOID using Activate and Select. Rather
Code:
   Sheets("MDI").Range("A1").QueryTable.Refresh BackgroundQuery:=False
If you cannot edit due to inabilty to access, you might need to check your access authority or reconfigure your ODBC driver


Skip,

[glasses] [red]Be Advised![/red] A chicken, who would drag a wagon across the road for 2 cents, is…
POULTRY in motion to PULLET for a PALTRY amount! [tongue]
 
This is a permissions error on the database. The userID credentials that are being passed to the database don't have permissions to read it

Rgds, Geoff

We could learn a lot from crayons. Some are sharp, some are pretty and some are dull. Some have weird names and all are different colours but they all live in the same box.

Please read FAQ222-2244 before you ask a question
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top