+ Reply to Thread
Results 1 to 9 of 9

Hewlp with pivot table range and table destination

  1. #1
    Forum Contributor
    Join Date
    10-12-2011
    Location
    Sydney
    MS-Off Ver
    Excel 2016 in 2024
    Posts
    857

    Hewlp with pivot table range and table destination

    Hi

    currently I have a macro that opens up workbooks in a folder, sets the area for the pivot table then places the table in cell BB1 in the current sheet.

    However I get an error, "Invalid procedure call or argument" on the highlighted red section below?

    Please Login or Register  to view this content.
    [/COLOR]

  2. #2
    Forum Expert
    Join Date
    08-12-2012
    Location
    Sydney, Australia
    MS-Off Ver
    Excel 2010
    Posts
    5,636

    Re: Hewlp with pivot table range and table destination

    Maybe...

    xlPivotTableVersion15 = Excel 2013
    your profile says excel 2010

    delete the two version out of the code and see if it still gives error

    Please Login or Register  to view this content.
    If you are satisfied with the solution(s) provided, please mark your thread as Solved.
    Select Thread Tools-> Mark thread as Solved. To undo, select Thread Tools-> Mark thread as Unsolved.

  3. #3
    Forum Contributor
    Join Date
    10-12-2011
    Location
    Sydney
    MS-Off Ver
    Excel 2016 in 2024
    Posts
    857

    Re: Hewlp with pivot table range and table destination

    thanks humdingaling. I am on 2013. I will update my profile.

    Managed to develop the following, however can't seem to add data fields, getting an error on the highlighted part below?

    Please Login or Register  to view this content.
    [/COLOR]

  4. #4
    Forum Expert
    Join Date
    08-12-2012
    Location
    Sydney, Australia
    MS-Off Ver
    Excel 2010
    Posts
    5,636

    Re: Hewlp with pivot table range and table destination

    you can shorten your code to this
    Please Login or Register  to view this content.
    unsure why you would get an error on it though
    if your srcdata correct?

  5. #5
    Forum Contributor
    Join Date
    10-12-2011
    Location
    Sydney
    MS-Off Ver
    Excel 2016 in 2024
    Posts
    857

    Re: Hewlp with pivot table range and table destination

    it was the srcdata, thanks humdingaling

  6. #6
    Forum Contributor
    Join Date
    10-12-2011
    Location
    Sydney
    MS-Off Ver
    Excel 2016 in 2024
    Posts
    857

    Re: Hewlp with pivot table range and table destination

    I spoke too soon

    It opens up the first workbook in the folder and it works fine, but then I get an error on the second workbook

    "Invalid procedure call or argument"

    on this line:

    Please Login or Register  to view this content.
    Any ideas as to why this is happening?

  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: Hewlp with pivot table range and table destination

    Hi,

    You should really enclose the sheet names in quotes in case they include spaces or special characters, and it would be better to only use the relevant range
    Please Login or Register  to view this content.
    changes highlighted.
    Don
    Please remember to mark your thread 'Solved' when appropriate.

  8. #8
    Forum Contributor
    Join Date
    10-12-2011
    Location
    Sydney
    MS-Off Ver
    Excel 2016 in 2024
    Posts
    857

    Re: Hewlp with pivot table range and table destination

    works perfectly, thanks xlnitwit

  9. #9
    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: Hewlp with pivot table range and table destination

    You're welcome.

+ 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. update and add rows to a destination table from my source table
    By mido609 in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 01-05-2014, 05:59 PM
  2. Changing Pivot Table Destination
    By kidengineer in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 09-26-2013, 06:33 PM
  3. Replies: 5
    Last Post: 01-06-2012, 04:35 PM
  4. Pivot Table Data Destination
    By gnethery in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 03-23-2010, 03:11 PM
  5. Return pivot table range...not the data table, the PIVOT TABLE!
    By Air_Cooled_Nut in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 02-26-2008, 01:07 PM
  6. Pivot table Destination
    By moglione1 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 02-22-2006, 02:10 PM
  7. [SOLVED] Refresh Pivot Table: Do you want to replace the destination cells
    By pgchop in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 01-19-2006, 08:35 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