+ Reply to Thread
Results 1 to 5 of 5

Recording Macro to create a Pivot Table in Excel 2013: run time error 5 invalid procedure

  1. #1
    Registered User
    Join Date
    10-22-2013
    Location
    new jersey
    MS-Off Ver
    Excel 2010; Excel 2013
    Posts
    2

    Recording Macro to create a Pivot Table in Excel 2013: run time error 5 invalid procedure

    Hello All,

    Upfront, I don't know much about VBA programming and am still learning a lot in Excel so please be patient with me. Here is my issue, I was asked to work on a small project at work, the dept needs to export data from Access into an Excel worksheet and count the number of students in each grade per school.

    I figured the simplest thing to do would be to create a pivot table. The dept will be doing these counts pretty frequently as they add students to list in Access, I figured recording a macro would simplify things as they can run the macro and it will sort, create the PT and provide a last run date.

    When I run the macro I get an error: "Run time error 5 invalid procedure call" code provided below.
    Can someone please help me with this problem? What am I doing wrong?

    Thank You all in advance.

    Please Login or Register  to view this content.

    Full Code for entire Macro:
    Please Login or Register  to view this content.
    Last edited by alansidman; 10-23-2013 at 09:46 PM. Reason: code tags added

  2. #2
    Forum Moderator alansidman's Avatar
    Join Date
    02-02-2010
    Location
    Steamboat Springs, CO
    MS-Off Ver
    MS Office 365 Version 2405 Win 11 Home 64 Bit
    Posts
    23,873

    Re: Recording Macro to create a Pivot Table in Excel 2013: run time error 5 invalid proced

    Your post does not comply with Rule 3 of our Forum RULES. Use code tags around code.

    Posting code between [CODE]Please [url=https://www.excelforum.com/login.php]Login or Register [/url] to view this content.[/CODE] tags makes your code much easier to read and copy for testing, it also maintains VBA formatting.

    Highlight your code and click the # icon at the top of your post window. More information about these and other tags can be found here



    (I have added them for you this time. Please read the rules and follow them in the future)
    Alan עַם יִשְׂרָאֵל חַי


    Change an Ugly Report with Power Query
    Database Normalization
    Complete Guide to Power Query
    Man's Mind Stretched to New Dimensions Never Returns to Its Original Form

  3. #3
    Registered User
    Join Date
    10-22-2013
    Location
    new jersey
    MS-Off Ver
    Excel 2010; Excel 2013
    Posts
    2

    Re: Recording Macro to create a Pivot Table in Excel 2013: run time error 5 invalid proced

    Hi Alan,

    My apologies, I'm new to the forum but I will be sure to follow the rules in the future. Thank you.

  4. #4
    Forum Guru JosephP's Avatar
    Join Date
    03-27-2012
    Location
    Ut
    MS-Off Ver
    2003/10
    Posts
    7,328

    Re: Recording Macro to create a Pivot Table in Excel 2013: run time error 5 invalid proced

    I reckon the simplest thing would be to link the pivot table to an Access query and then just refresh it when necessary. no code required :-)
    Josie

    if at first you don't succeed try doing it the way your wife told you to

  5. #5
    Forum Moderator alansidman's Avatar
    Join Date
    02-02-2010
    Location
    Steamboat Springs, CO
    MS-Off Ver
    MS Office 365 Version 2405 Win 11 Home 64 Bit
    Posts
    23,873

    Re: Recording Macro to create a Pivot Table in Excel 2013: run time error 5 invalid proced

    Another alternative is to run an Aggregate query in Access and export the results directly to Excel. No need to run a PT. Assuming you have a field for the Grade and the Student Name

    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. Run time error '5': Invalid procedure call or arguement (excel 2007)
    By Excel_novice1 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 03-05-2012, 05:40 PM
  2. Macro Run Time error - Invalid procedure call or argument
    By clundeen in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 11-01-2011, 01:59 AM
  3. Replies: 1
    Last Post: 01-14-2010, 12:52 PM
  4. "Invalid procedure call or argument" error when creating Pivot table
    By Kaigi in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 10-31-2009, 06:02 AM
  5. Recording a Macro to create a Pivot Table
    By Sandi B in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 05-09-2006, 06:15 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