+ Reply to Thread
Results 1 to 7 of 7

Pivot table source path

  1. #1
    Forum Contributor
    Join Date
    03-08-2011
    Location
    Lubbock, TX, USA
    MS-Off Ver
    MS OFFICE 365 EXCEL, OUTLOOK, WORD, POWERPOINT
    Posts
    194

    Pivot table source path

    I have a pivot table in one workbook whose source data is in another workbook. If I move the source file the second file gives me an error message because it can't find the pivot table. I'm glad that appeared now. I will be distributing this setup to another user who will do the same thing I do for the other half of the company.

    I'd like to make it so the pivot table will update as long as the source workbook is in the same folder as the destination. That way I can put THEM BOTH on my desktop while my friend puts them in a folder off the C drive if he wants to.

    Is this possible? If not I will have to merge the two workbooks. Due to the sheer number of formulas and macros each book has that might create a few problems on it's own.

    I appreciate any discussion. I don't expect anyone to give me a turnkey answer. Whatever you advise that I don't understand will go on my reading list.

    many thanks to all.

  2. #2
    Forum Expert NeedForExcel's Avatar
    Join Date
    03-16-2013
    Location
    Pune, India
    MS-Off Ver
    Excel 2016:2019, MS 365
    Posts
    3,873

    Re: Pivot table source path

    Hi,

    I do not think you can have your Source data and the Pivot table on 2 separate workbooks.
    Cheers!
    Deep Dave

  3. #3
    Forum Contributor
    Join Date
    03-08-2011
    Location
    Lubbock, TX, USA
    MS-Off Ver
    MS OFFICE 365 EXCEL, OUTLOOK, WORD, POWERPOINT
    Posts
    194

    Re: Pivot table source path

    Hi Dave. I don't understand your comment sir. I have two separate workbooks. One is for techs and the other is for inventory control. In one tab of the tech workbook there is a pivot table. That pivot table is made with data from a range in the inventory control workbook.

    I moved the inventory control workbook from my desktop to my Google Drive folder. When I went to refresh the pivot table in the tech workbook, it told me it couldn’t find the source data. I can change the data source by adding my google drive location and it all works again.

    I’m trying to figure out a method so that as long as the two files are in the same folder, any folder, they will still work together. Thanks. For taking the time to look at my question.

  4. #4
    Forum Guru xlnitwit's Avatar
    Join Date
    06-27-2016
    Location
    London
    MS-Off Ver
    Windows: 2010; Mac: 16.13 (O365)
    Posts
    7,085

    Re: Pivot table source path

    You could use code to amend the pivot table's SourceData property at Workbook_Open, assuming the source file name is constant (so that you can simply append to ThisWorkbook.Path & "\")
    Don
    Please remember to mark your thread 'Solved' when appropriate.

  5. #5
    Forum Contributor
    Join Date
    03-08-2011
    Location
    Lubbock, TX, USA
    MS-Off Ver
    MS OFFICE 365 EXCEL, OUTLOOK, WORD, POWERPOINT
    Posts
    194

    Re: Pivot table source path

    Quote Originally Posted by xlnitwit View Post
    You could use code to amend the pivot table's SourceData property at Workbook_Open, assuming the source file name is constant (so that you can simply append to ThisWorkbook.Path & "\")
    Don, you might just be my new best friend. It never occurred to me to look for a pivot table in the VBA editor at all. And as luck would have it I've used the attribute you mentioned in my import macros. I'll try it out tomorrow and let you know. ��
    Last edited by Mr_Phil; 01-11-2018 at 08:59 PM. Reason: Spell check hates me.

  6. #6
    Forum Contributor
    Join Date
    03-08-2011
    Location
    Lubbock, TX, USA
    MS-Off Ver
    MS OFFICE 365 EXCEL, OUTLOOK, WORD, POWERPOINT
    Posts
    194

    Re: Pivot table source path

    Wow that is harder than I thought it would be. I can't find anything in the VBA Editor that defines the pivot table. In despair I even tried pasting this into the "change source data" part on the ribbon. NOT gonna work. Bummer.

    Please Login or Register  to view this content.

  7. #7
    Forum Guru xlnitwit's Avatar
    Join Date
    06-27-2016
    Location
    London
    MS-Off Ver
    Windows: 2010; Mac: 16.13 (O365)
    Posts
    7,085

    Re: Pivot table source path

    The code would be something like this (in the ThisWorkbook module)
    Please Login or Register  to view this content.

+ 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. Replies: 0
    Last Post: 01-06-2016, 07:00 AM
  2. Replies: 10
    Last Post: 06-19-2015, 05:04 AM
  3. Replies: 0
    Last Post: 06-30-2014, 10:19 AM
  4. Data Source path in Pivot Table changes to absolute on its own
    By SergSlim in forum Excel Charting & Pivots
    Replies: 1
    Last Post: 08-20-2013, 07:26 AM
  5. Replies: 1
    Last Post: 06-22-2010, 09:10 AM
  6. [SOLVED] Q: Change pivot table source path?
    By Mark in forum Excel General
    Replies: 1
    Last Post: 07-26-2006, 07:45 PM
  7. [SOLVED] Can't change source data path for Pivot Chart
    By Mike B in VT in forum Excel Charting & Pivots
    Replies: 1
    Last Post: 02-18-2006, 07:43 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