+ Reply to Thread
Results 1 to 4 of 4

Establishing ODBC connection and refreshing data using Macro/VBA

  1. #1
    Registered User
    Join Date
    06-01-2016
    Location
    California
    MS-Off Ver
    2016
    Posts
    2

    Establishing ODBC connection and refreshing data using Macro/VBA

    Hi - I'm new. My team is using PowerPivot to refresh data from our ERP using ODBC. Then using the data to pivot into a report template for P&L.

    My question is, is there a way to using macro/VBA to automate the refresh of data process using ODBC? I wasn't sure if this was possible given we have to use a unique user ID/password to get access via ODBC for each individual.

    If there is a way, I would greatly appreciate it. I'm currently trying to reduce the number of "steps" required to refresh a P&L report every month.

    J

  2. #2
    Forum Expert
    Join Date
    02-14-2009
    Location
    .
    MS-Off Ver
    ................
    Posts
    2,840

    Re: Establishing ODBC connection and refreshing data using Macro/VBA

    If you try to connect to an ODBC source and don't provide the credentials then the ODBC driver usually displays a prompt for the ID/Password... I did say 'usually' so this is probably the odd time it doesn't - why don't you just try connecting in code without supplying the password and see what happens?

  3. #3
    Registered User
    Join Date
    06-01-2016
    Location
    California
    MS-Off Ver
    2016
    Posts
    2

    Re: Establishing ODBC connection and refreshing data using Macro/VBA

    I guess we can give that a try. My guess is the prompt for the password will stop the macro in the middle so it won't run the rest to refresh the data but I guess we can possibly make it a two click process instead of just one.

  4. #4
    Forum Expert
    Join Date
    02-14-2009
    Location
    .
    MS-Off Ver
    ................
    Posts
    2,840

    Re: Establishing ODBC connection and refreshing data using Macro/VBA

    My guess is the prompt for the password will stop the macro
    It will, but you never mentioned anything about that in your post - the only alternative is to store the IDs/Passwords locally and pass them in the connection string.
    Please Login or Register  to view this content.
    You need to check your local security policies with the DBAs. they tend to get upset when credentials are not secure - and VBA/Excel worksheets are not secure environments.
    Last edited by cytop; 06-01-2016 at 04:21 AM.

+ 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. Error while establishing a connection with HP ALM server
    By sugaprasad in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 09-12-2016, 05:02 AM
  2. refreshing data connection erroring
    By 13lack13lade in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 10-27-2014, 03:08 AM
  3. [SOLVED] Importing data using ODBC connection
    By gspotts in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 06-05-2014, 02:58 PM
  4. [SOLVED] Use ODBC connection without setting it up in ODBC administration
    By ExcelGal in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 07-18-2012, 09:59 AM
  5. Excel VBA makes ODBC connection to Access-How do you close the connection?
    By MrHockey in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 05-04-2010, 06:29 PM
  6. [SOLVED] Macro to change odbc connection settings
    By bugmenot in forum Excel Programming / VBA / Macros
    Replies: 11
    Last Post: 07-22-2009, 04:30 AM
  7. basic macro for ODBC connection
    By ExcelUser4 in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 05-01-2007, 05:36 PM

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