+ Reply to Thread
Results 1 to 3 of 3

VBA trigger action after data from other sources are refreshed

Hybrid View

  1. #1
    Registered User
    Join Date
    06-02-2013
    Location
    Sydney
    MS-Off Ver
    Excel 2007
    Posts
    19

    VBA trigger action after data from other sources are refreshed

    Hi guys,

    is there a way to run a procedure after data from other sources (MS Query/DB) are refreshed?
    I set the property for this connection to "Refresh data when opening the file".

    I want to copy some part of this data to another worksheet, so I have added code to the ThisWorkbook object.
    Procedure is fired after opening the file, but before the data are retrieved from DB. So it copies nothing...

    Thanks

    Private Sub Workbook_Open()
        Worksheets("Test").Activate
        Worksheets("Test").Range("A1:V500").Value = Worksheets("ORQData2").Range("A1:V500").Value
    End Sub

  2. #2
    Forum Expert JasperD's Avatar
    Join Date
    05-07-2013
    Location
    Netherlands
    MS-Off Ver
    Excel 2016
    Posts
    1,393

    Re: VBA trigger action after data from other sources are refreshed

    Put the connection refresh in the workbook_open macro instead of putting it as property ?
    Please click the * below if this helps

  3. #3
    Registered User
    Join Date
    06-02-2013
    Location
    Sydney
    MS-Off Ver
    Excel 2007
    Posts
    19

    Re: VBA trigger action after data from other sources are refreshed

    Thanks, did not not this can be done.

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

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