+ Reply to Thread
Results 1 to 3 of 3

Query External Data - Username/Password Suppression

  1. #1
    Registered User
    Join Date
    07-31-2014
    Location
    Minnesota
    MS-Off Ver
    Excel 2010
    Posts
    5

    Query External Data - Username/Password Suppression

    Hi, I have code that will query an external data source using my username and password in VBA (username and password are supplied through a userform. This way, I will not see the Excel dialog box pop up for my username and password. This code works just fine (User, Password, and SQL are variables...self explanatory what each is):

    Please Login or Register  to view this content.

    Now, where I'm running into trouble is when I want to return results in a pivot table rather than rows on a sheet. For the next piece of code to work, I have a pivot table already created on sheet3 that was originally setup to query an external source (editing a normal pivot table not setup with the external source doesn't work). I edit the connection and commandtext, but as soon as I run the commandtext line, Excel's username/password dialog box will pop up, but I have already provide that information in the connection. Can anyone help me be able to suppress the Excel dialog box and use the username and password that I supplied???

    Please Login or Register  to view this content.

  2. #2
    Valued Forum Contributor
    Join Date
    09-21-2011
    Location
    Birmingham UK
    MS-Off Ver
    Excel 2003/7/10
    Posts
    2,188

    Re: Query External Data - Username/Password Suppression

    How have you declared Password ?
    Hope this helps

    Sometimes its best to start at the beginning and learn VBA & Excel.

    Please dont ask me to do your work for you, I learnt from Reading books, Recording, F1 and Google and like having all of this knowledge in my head for the next time i wish to do it, or wish to tweak it.
    Available for remote consultancy work PM me

  3. #3
    Registered User
    Join Date
    07-31-2014
    Location
    Minnesota
    MS-Off Ver
    Excel 2010
    Posts
    5

    Re: Query External Data - Username/Password Suppression

    Yes, I have it declared. I have this setup to receive the username and password from a userform, so the rest of my code is something like this...

    Please Login or Register  to view this content.
    Both pieces of query code that I pasted in the first thread are in the same SQLQuery sub, which is why I'm so confused why one works and the other doesn't.

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. External web query to insert password
    By RossChapman in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 05-28-2013, 04:20 PM
  2. [SOLVED] Username and Password Form - Show Username in Sheet
    By ryan180 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 01-24-2013, 07:06 PM
  3. Change external data source depending on username
    By Jack M in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 06-04-2009, 10:56 AM
  4. Bypass username/password prompt when executing an excel web query
    By Richard Flame in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 02-24-2007, 01:20 PM
  5. refresh Query table using own password for each username
    By kuh in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 02-07-2006, 01:35 AM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1