Wrox Programmer Forums
Go Back   Wrox Programmer Forums > Microsoft Office > Excel VBA > Excel VBA
Excel VBA Discuss using VBA for Excel programming.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Excel VBA section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
Old October 5th, 2006, 03:40 PM
Registered User
Join Date: Oct 2006
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Default Refresh Excel QueryTable using VBA

I'm trying to refresh an existing query in a hidden sheet and keep that sheet hidden. The query uses an ODBC connection to an SQL database. The problem is that the SWL server requests the userid and password before completing the refresh. How can I clean this up and automatically feed ther connection srtring?

Private Sub update_inventory_Click()
  Sheets("Invent").Visible = True
  Selection.QueryTable.Refresh BackgroundQuery:=False
  Sheets("Invent").Visible = False
End Sub



Similar Threads
Thread Thread Starter Forum Replies Last Post
[VB2005]Import textfiles to Excel using QueryTable bellaelysium Visual Studio 2005 0 July 28th, 2008 01:32 AM
Code works in Excel VBA but not Access VBA fossx Access VBA 2 May 21st, 2007 08:00 AM
Add and Refresh Excel QueryTable from VBA DaveJoyG Excel VBA 2 September 28th, 2006 07:23 AM
VBA - Form Refresh lxu Access 2 March 4th, 2004 11:13 AM
VBA - Form refresh lxu XML 2 March 3rd, 2004 01:49 PM

Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.