+ Reply to Thread
Results 1 to 7 of 7

Refreshing Pivot tables in a folder

  1. #1
    Forum Contributor
    Join Date
    11-11-2012
    Location
    Muscat, Oman
    MS-Off Ver
    Office 365
    Posts
    521

    Refreshing Pivot tables in a folder

    Hello Experts,

    I have a folder containing 33 excel files and all of them are Pivot Tables in one sheet.

    All files are linked to One external Data Source in Access which gets updated once a month.
    Please advise if all 33 pivot tables in 33 files can be updated (Refreshed) using a macro.

    Best Regards/VKS

  2. #2
    Valued Forum Contributor
    Join Date
    09-01-2013
    Location
    Dallas, TX
    MS-Off Ver
    Excel 2010
    Posts
    324

    Re: Refreshing Pivot tables in a folder

    Yes. Try this: Will refresh and update every workbook in a directory. Just edit the directory line:

    Please Login or Register  to view this content.


    Shelton A.
    If Helpful, Add Reputaion!

  3. #3
    Forum Contributor
    Join Date
    11-11-2012
    Location
    Muscat, Oman
    MS-Off Ver
    Office 365
    Posts
    521

    Re: Refreshing Pivot tables in a folder

    Hello Shelton,

    Thanks a lot for your time & my apologies for the delay in response. Since the folder is on work machine, I had to wait till I came back to work.
    Pasted the folder on desktop and tried to run the code

    Within a second got the dialogue box that All Pivot Tables are updated but none got updated and noticed that “\” was missing at the end of directory name & changed it to

    sPath = "C:\Users\92281\Desktop\Mar\"


    This time I got a run time error 429 : ActiveX component cant create object on line
    For Each Sheet In ThisWorkbook.worksheets

    Please note the only change that I have made is changing the file path.

    Am I missing something. Please Advise.

    Best Regards/VKS

  4. #4
    Valued Forum Contributor
    Join Date
    09-01-2013
    Location
    Dallas, TX
    MS-Off Ver
    Excel 2010
    Posts
    324

    Re: Refreshing Pivot tables in a folder

    Since you have only 1 sheet in each file lets bypass that line of code and tell me what it does. If you make it to the end but with no update then we may have to insert a line to open the main document until all workbooks have updated and then close it.


    Please Login or Register  to view this content.

  5. #5
    Forum Contributor
    Join Date
    11-11-2012
    Location
    Muscat, Oman
    MS-Off Ver
    Office 365
    Posts
    521

    Re: Refreshing Pivot tables in a folder

    Hi,
    This time I got run time error 1004 : Refresh Table Method Of Pivot Table Class failed & the line is
    Pivot.RefreshTable
    Thanks once again
    Best Regards/VKS

  6. #6
    Valued Forum Contributor
    Join Date
    09-01-2013
    Location
    Dallas, TX
    MS-Off Ver
    Excel 2010
    Posts
    324

    Re: Refreshing Pivot tables in a folder

    Hmmm I would need to see two of your workbooks. This can often happen if apostrophes are in your code somewhere in ascii format or if a name to a table is spelled wrong. Either way I would need to see a couple of workbooks to isolate the issue as the code runs fine for me.

  7. #7
    Forum Contributor
    Join Date
    11-11-2012
    Location
    Muscat, Oman
    MS-Off Ver
    Office 365
    Posts
    521

    Re: Refreshing Pivot tables in a folder

    Hello Shelton,

    Was travelling and couldn't respond earlier. Thanks for your time and suggestion but it is not possible for me to share the original files.
    You already have rep to say thank you for your effort and time.

    Best Regards/VKS

+ 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. Refreshing pivot tables..
    By geliedee in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 10-25-2013, 12:32 AM
  2. Refreshing Pivot tables
    By j_Southern in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 02-29-2012, 10:51 PM
  3. Excel 2007 : Refreshing Pivot Tables
    By muralikreddy in forum Excel General
    Replies: 3
    Last Post: 06-17-2010, 06:15 AM
  4. Refreshing multiple pivot tables
    By jerredjohnson in forum Excel General
    Replies: 2
    Last Post: 05-02-2006, 01:30 PM
  5. Refreshing pivot tables
    By matpj in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 03-20-2006, 11:40 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