+ Reply to Thread
Results 1 to 1 of 1

Auto save Excel ODBC Connection to data source without opening file

  1. #1
    Forum Contributor
    Join Date
    08-08-2012
    Location
    USA, CA
    MS-Off Ver
    Excel 2007
    Posts
    131

    Question Auto save Excel ODBC Connection to data source without opening file

    Hello all,

    Is there a way to auto refresh my workbook's ODBC connection and auto save without the need to open the file? I want to start time refresh auto save at 7a and 7p everyday.

    Thank you,
    Newb


    --update
    I created the following code to automatically refresh data at timed intervals, but I still need to find a way to have this run without physically opening up excel.

    VB Code written in "this workbook":

    Private Sub Workbook_Open()
    Application.OnTime TimeValue("7:00:00"), "MyMacro"
    End Sub
    Private Sub Workbook_Open1()
    Application.OnTime TimeValue("19:00:00"), "MyMacro1"
    End Sub

    VB Code written in "Module"
    Sub MyMacro()
    Application.OnTime TimeValue("7:00:00"), "MyMacro"
    ActiveWorkbook.RefreshAll
    ActiveWorkbook.Save
    End Sub
    Sub MyMacro1()
    Application.OnTime TimeValue("19:00:00"), "MyMacro1"
    ActiveWorkbook.RefreshAll
    ActiveWorkbook.Save
    End Sub
    Last edited by newbie4; 04-01-2015 at 03:48 PM. Reason: UPDATE

+ 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. Create Excel Function that Gets Data via ODBC Connection
    By Tyrone__ in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 01-29-2014, 02:38 PM
  2. How to test successful connection to ODBC source using ListObject/QueryTable?
    By beacon in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 04-01-2013, 10:03 AM
  3. Replies: 0
    Last Post: 07-01-2010, 09:34 AM
  4. 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
  5. [SOLVED] How do I set up my ODBC Connection from AS/400 file in Excel 2003
    By HTIMAPICSAdmin in forum Excel General
    Replies: 0
    Last Post: 06-01-2005, 04:05 PM

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