Results 1 to 4 of 4

Auto Login to Edit Web Query dialog

Threaded View

  1. #1
    Registered User
    Join Date
    08-07-2012
    Location
    Athens
    MS-Off Ver
    Excel 2010
    Posts
    2

    Auto Login to Edit Web Query dialog

    Hi all,

    I have inserted in a sheet a web connection.
    to refresh that connection I use the following macro:
    -------------
    Sub Refresh_Connection_to_SF_Report()
        Sheets("Sheet with connection to SF").Select
        ActiveWorkbook.Connections("Connection to SF Report").Refresh
    End Sub
    -------------

    it works beautifully but I need to login before I run this code.
    Currently this is manual by doing the 3 steps below.

    I would like a macro that emulates the following actions:

    1. Right click into "Sheet with connection to SF", select "Edit Query"
    2. enter username and password (taken from sheet "Credentials": user name in B1, Password in B2), click Login (NOT Import)
    3. Click Import

    there is no need for the user to see this process (it can happen on the background)

    I just need to push the button and refresh the data connection circumventing the login issue:
    if I am not logged in, log me in (execute the 3 steps) and refresh the data connection
    if I am logged in, (ignore the 3 steps) just refresh the data connection

    is this possible?
    (FYI: using excel 2010, Google chrome as default browser, but as this will be used by other people, it would be cool for the macro to work with all browsers)

    thank you very much in advance for your help.
    Last edited by arlu1201; 08-07-2012 at 08:39 AM.

Thread Information

Users Browsing this Thread

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

Tags for this Thread

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