+ Reply to Thread
Results 1 to 3 of 3

external data connections are not refreshing even with VBA

  1. #1
    Registered User
    Join Date
    04-17-2013
    Location
    london
    MS-Off Ver
    Excel 2007
    Posts
    22

    external data connections are not refreshing even with VBA

    hi there,
    i do possess a dashboard workbook in which contains pivot tables and charts. All of them are through external data connections. But, some are refreshing and some are not....Posting here the code....Also, sendkeys function is not working...Please help....i nearly tries everything and wasted hours....


    Private Sub Workbook_BeforeClose(Cancel As Boolean)
    ActiveWorkbook.RefreshAll
    Workbooks.Open Filename:="C:\Users\RadheRadhe\Desktop\Javak & Hopper.xlsm", Password:="crushergrit"
    Application.Wait Now + TimeValue("00:00:02")
    Workbooks.Open Filename:="C:\Users\RadheRadhe\OneDrive\Dashboard.xlsx"
    Interaction.SendKeys "^%{F5}"
    ActiveWorkbook.RefreshAll
    Interaction.SendKeys ("^%{F5}")
    Application.Wait Now + TimeValue("00:00:05")
    Workbooks("Javak & Hopper.xlsm").Save
    Workbooks("Javak & Hopper.xlsm").Close
    Workbooks("Dashboard.xlsx").Save
    Workbooks("Dashboard.xlsx").Close
    ActiveWorkbook.Save
    End Sub

    Private Sub Workbook_Open()
    Call expbarrel
    Call expoil
    End Sub

  2. #2
    Forum Expert
    Join Date
    10-09-2012
    Location
    Dallas, Texas
    MS-Off Ver
    MO 2010 & 2013
    Posts
    3,049

    Re: external data connections are not refreshing even with VBA

    I had a similar issue and it was not the code but free RAM available. Pivot Tables could not update because of this.
    Please ensure you mark your thread as Solved once it is. Click here to see how.
    If a post helps, please don't forget to add to our reputation by clicking the star icon in the bottom left-hand corner of a post.

  3. #3
    Registered User
    Join Date
    04-17-2013
    Location
    london
    MS-Off Ver
    Excel 2007
    Posts
    22

    Re: external data connections are not refreshing even with VBA

    No....indeed i did try sending keys thru another xlsm file....it worked....but again when i link that another xlsm file in original code...it does not send keys....it does not refreshes data....

+ 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. [SOLVED] Opening, refreshing data connections, saving and closing file with VBA
    By jtukes in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 10-22-2013, 03:31 PM
  2. Data Connections : Saving history before refreshing?
    By brianlg in forum Excel General
    Replies: 0
    Last Post: 10-10-2013, 12:07 PM
  3. external data - cleanup existing connections
    By edstevens in forum Excel General
    Replies: 1
    Last Post: 04-26-2013, 12:03 PM
  4. Refreshing workbook connections
    By Thamizh in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 10-04-2010, 01:30 AM
  5. Pulling Data from unopened Excel Spreadsheets with external connections
    By nschneemann in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 03-04-2010, 11:26 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