+ Reply to Thread
Results 1 to 4 of 4

vba Power Query refresh in Task Scheduler job not working

  1. #1
    Registered User
    Join Date
    11-13-2019
    Location
    Leusden, Netherlands
    MS-Off Ver
    2016 or 2019 (depends on PC)
    Posts
    12

    vba Power Query refresh in Task Scheduler job not working

    First of all this is a cross-posting: after 2.5 days without reply I don't expect that anymore. Link to original:

    - since this is my first post I'm not allowed to post the link. It isfrom MrExcel forum with this title: "Power Query refresh in Task Scheduler job not working";

    Modified the text a bit from the original:

    Dear all,

    I developed an application with 6 Power Queries (4 from same Access database, 1 from a textfile, and 1 from another XL). (Excel 2016, Get & Transform)
    These queries combine data and result in one table. Then a macro is runned to copy the table to a new workbook, reformat and save it, while not saving the spreadsheet containing the PQ's, macro and the PQ-result-table).

    The code to refresh and run the macro is the the Workbook_Open to get is automated.

    Works perfectly from the desktop - just double click and wait till it is closed, I ran it very often during development of the formatting etc. -macro.
    I however need it to run over night in a scheduled task. That is where the problem starts: it keeps running (hangs) and the PQ's are not refreshed.

    I spent nearly a whole working day figuring it out - yes google, google and google and try, try and try, but did not succeed. Please take a look at my workbook_open macro. Any suggestion is very welcome. I commented out the macro: when the macro starts, it gets stuck due to lack of proper data - happens irregularly, now and then, but most of the times the macro does not start at all: program keeps hanging. I see it when I cancel the running job.

    VBA Code:

    Please Login or Register  to view this content.
    Any help appreciated,
    kind regards

    Hans Troost

  2. #2
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (both in England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2507 (Windows 11 Home 24H2 64-bit)
    Posts
    91,822

    Re: vba Power Query refresh in Task Scheduler job not working

    That was your 10th post here, so please post another post to this thread containing the link, which you should now be able to include. Thanks.
    Ali


    Enthusiastic self-taught user of MS Excel who's always learning!
    Don't forget to say "thank you" in your thread to anyone who has offered you help. It's a universal courtesy.
    You can reward them by clicking on * Add Reputation below their user name on the left, if you wish.

    NB:
    as a Moderator, I never accept friendship requests.
    Forum Rules (updated August 2023): please read them here.

  3. #3
    Registered User
    Join Date
    11-13-2019
    Location
    Leusden, Netherlands
    MS-Off Ver
    2016 or 2019 (depends on PC)
    Posts
    12

    Re: vba Power Query refresh in Task Scheduler job not working

    Thanks, for your reply - I got the error message that I couldn’t post the link, but here it is:

    https://www.mrexcel.com/board/thread...rking.1168112/

    Thanks again, Hans

  4. #4
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (both in England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2507 (Windows 11 Home 24H2 64-bit)
    Posts
    91,822

    Re: vba Power Query refresh in Task Scheduler job not working

    That was because you had too few posts. You don't now.

+ 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. OLEDBConnection.Refresh Stopping On Task Scheduler Run
    By swolfe2 in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 01-28-2020, 03:06 PM
  2. Excel Power Query Refresh or Access Query - 2nd Query Run is faster
    By Steveapa in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 01-03-2020, 10:16 AM
  3. Power Query refresh button not working where backgroundquery = false
    By jaryszek in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 12-13-2019, 06:02 AM
  4. Excel VBA Script Crashes When Refreshing Power Queries Using Task Scheduler
    By beaglesBuddy in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 02-16-2017, 01:03 AM
  5. code to refresh power query not working ..
    By Hassan1977 in forum Excel General
    Replies: 0
    Last Post: 08-31-2016, 12:31 PM
  6. Task Scheduler Stopped Working - Excel
    By profector in forum Microsoft Windows Help
    Replies: 2
    Last Post: 01-28-2014, 11:11 AM
  7. PDF Printing of sheets from task scheduler when client is logged off is not working..Help!
    By Mr.FutureCoder in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 09-14-2012, 03:19 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