+ Reply to Thread
Results 1 to 6 of 6

Automate Access query extraction to Excel

  1. #1
    Registered User
    Join Date
    01-11-2022
    Location
    Portugal
    MS-Off Ver
    2016
    Posts
    6

    Automate Access query extraction to Excel

    Hello everybody,

    I have some Excel dashboards which are updated manually in the following steps:

    1 - Extract a query (Or several queries) from 1 or more databases.

    2 - Copy/Extract the query and paste it on a sheet in the Excel dashboard. The dashboard are usually made with formulas and not with pivot tables so the data is automatically updated.

    The queries usually do not change for the respective dashboards, unless new fields of data are needed.

    What I would like to do is automate the Excel dashboard as something close to what Power BI does, so that anyone that checks the dashboard can click on a refresh button and the data is updated.

    Any suggestion is helpful, even if is only a close solution to what I am looking for.

    Thank you.

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

    Re: Automate Access query extraction to Excel

    Welcome to the forum.

    I wonder why you are not importing the queries automatically using PowerQiuery? What sort of database are we talking about?

    There are instructions at the top of the page explaining how to attach your sample workbook.

    A good sample workbook has just 10-20 rows of representative data that has been desensitised. It also has expected results mocked up, relevant cells highlighted and a few explanatory notes.
    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.
    You can reward them by clicking on * Add Reputation below their user name on the left, if you wish.

    Forum Rules (updated August 2023): please read them here.

  3. #3
    Registered User
    Join Date
    01-11-2022
    Location
    Portugal
    MS-Off Ver
    2016
    Posts
    6

    Re: Automate Access query extraction to Excel

    Thank you!

    I am not familiar with Power Query, but I am not sure the data model can support this. I will try to describe with more detail.

    I have around 5-10 Access databases which are all close to 2gb.

    The queries are usually done with the following join properties: "Only include rows where the joined fields from both tables are equal".

    There are no primary keys attributed in the databases.

    For a simple dashboard I usually use around 3-4 databases, and several queries, such as extraction, pivot tables, create tables, or appends.

    Then the data is pasted as is exported, since the excel sheet is ready to receive the data in that format (vlookups/sumifs/countifs are made to predetermined columns).

    Is there a way I create this data model with several queries in power query, and then the data is presented in the right format in one sheet and can be extracted with a button? Will this process take as long as Access does? Some of our queries take 15 to 30 min.

    I will try to create a sample workbook but I am not yet sure if I will be able to do it.

    Thank you again.

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

    Re: Automate Access query extraction to Excel

    You can import Access queries using PowerQuery and reformat them to suit whatever you need to do with them.

    https://docs.microsoft.com/en-us/pow...accessdatabase

  5. #5
    Registered User
    Join Date
    01-11-2022
    Location
    Portugal
    MS-Off Ver
    2016
    Posts
    6

    Re: Automate Access query extraction to Excel

    Thank you for the quick reply.

    I was able to extract the Query to an excel sheet. This would work. But I still have one problem.

    This will refresh with the data that is in that Query at the moment, but we need to run the macro in access before the refresh for the data to be updated right?

    Is there a way I can automate or create a button that first runs the Access macro, and then refreshes the query?

    Thank you.

  6. #6
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2404 (Windows 11 22H2 64-bit)
    Posts
    79,365

    Re: Automate Access query extraction to Excel

    This code will refresh all:

    Please Login or Register  to view this content.
    It can be attached to a button, if required. PowerQueries can be set to update when the workbook is opened and automatically every minute.

+ 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. 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
  2. Running an access append query with parameters from Excel. Access version 2010
    By anthony1312002 in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 04-14-2017, 04:48 PM
  3. Replies: 1
    Last Post: 09-08-2015, 08:12 PM
  4. Connection Issues, Excel To Access Query, Access 2010
    By onechief in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 05-03-2015, 07:09 PM
  5. [SOLVED] Trying to "automate" inserting record numbers in Access 2010 query
    By alcharbonneau in forum Access Tables & Databases
    Replies: 7
    Last Post: 05-18-2012, 01:03 PM
  6. Excel to Access extraction
    By [email protected] in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 02-08-2006, 01:55 PM
  7. [SOLVED] Automate Access from Excel
    By Ernst Guckel in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 04-16-2005, 05:07 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