+ Reply to Thread
Results 1 to 7 of 7

Invalid procedure with Create pivottable

  1. #1
    Registered User
    Join Date
    07-31-2013
    Location
    Nashville
    MS-Off Ver
    Excel 2010
    Posts
    13

    Invalid procedure with Create pivottable

    Thanks to help from this group, I'm on to the second stage and that is to take the data imported from "Sheet1" and generate a Pivot Chart. I did a "record macro" to get the basics of the chart and started by pasting that code into its own procedure. However, it errors trying to get to first base with a 400 error. "Invalid procedure call or argument".

    Please Login or Register  to view this content.
    Googling around, I can tell you it occurs when running the first time, and it has no trouble creating the empty worksheet. And of course, it's from the same version of Excel so it should have no trouble running its own code.

    I've removed the parts that were optional but it still fails. None of these variables exist in this new document as it is new when the first macro runs to pull/format the data in "Sheet1".

    A Windows Excel newbie as you can tell, thanx, sam
    Last edited by sam452; 12-04-2013 at 02:01 PM. Reason: solved.

  2. #2
    Forum Guru Izandol's Avatar
    Join Date
    03-29-2012
    Location
    *
    MS-Off Ver
    Excel 20(03|10|13)
    Posts
    2,581

    Re: Invalid procedure with Create pivottable

    Do you have Sheet4 in the workbook already? Does it have a pivot table already?

  3. #3
    Registered User
    Join Date
    07-31-2013
    Location
    Nashville
    MS-Off Ver
    Excel 2010
    Posts
    13

    Re: Invalid procedure with Create pivottable

    No, only have Sheet1, 2, 3. No pivot table/chart because I had just imported the raw data with another procedure.

    Even if there was a Sheet4, it happily creates subsequent blank worksheets before it errors out, sam

  4. #4
    Forum Guru Izandol's Avatar
    Join Date
    03-29-2012
    Location
    *
    MS-Off Ver
    Excel 20(03|10|13)
    Posts
    2,581

    Re: Invalid procedure with Create pivottable

    If Sheet4 is not present there will be an error.
    Please Login or Register  to view this content.

  5. #5
    Registered User
    Join Date
    07-31-2013
    Location
    Nashville
    MS-Off Ver
    Excel 2010
    Posts
    13

    Re: Invalid procedure with Create pivottable

    Thank you, running your code above as is, adding "End Sub" and adding Sheet4 still yields a 400 error. And adds a blank Sheet5.

    Rerunning it as below yields a "This Pivot Table field name is not valid" error.

    Please Login or Register  to view this content.
    My data on Sheet1 has column headers, the same column headers on Row1 that I used to generate the "Record Macro" that is the basis of this effort and it was happy to use these column headers. There are no blank records that I've found and the columns seem to be right.

    Spending the day researching possible causes for this error, I followed this link and added apostrophes to "Sheet1" and still get the same field name not valid error.

    I don't see where to set the pivot table field name? thanks for helping me get to first base, sam

  6. #6
    Forum Guru Izandol's Avatar
    Join Date
    03-29-2012
    Location
    *
    MS-Off Ver
    Excel 20(03|10|13)
    Posts
    2,581

    Re: Invalid procedure with Create pivottable

    The field names come from the first row of data. What do you have in cells A1:K1 on Sheet1?

  7. #7
    Registered User
    Join Date
    07-31-2013
    Location
    Nashville
    MS-Off Ver
    Excel 2010
    Posts
    13

    Re: Invalid procedure with Create pivottable

    YES, thank you for pointing out my mistake. Counting my columns I find that I don't have 11 but 9 so my SourceData is wrong. I guess it's an "off by two" error. Thanks again for your time, sam

+ 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. Recording Macro to create a Pivot Table in Excel 2013: run time error 5 invalid procedure
    By developerstew in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 10-25-2013, 07:17 AM
  2. [SOLVED] Invalid Outside Procedure
    By bookworm121 in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 02-24-2013, 07:52 PM
  3. Help With Invalid Outside Procedure
    By nicolasespinosa in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 09-22-2011, 05:28 AM
  4. Invalid outside procedure
    By BRISBANEBOB in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 10-26-2010, 04:26 PM
  5. Invalid Outside Procedure
    By uaguy3005 in forum Excel Programming / VBA / Macros
    Replies: 8
    Last Post: 04-22-2009, 05:16 AM

Tags for this Thread

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