+ Reply to Thread
Results 1 to 10 of 10

Recorded macro doesn't work 5 seconds after creation...

  1. #1
    Registered User
    Join Date
    10-05-2011
    Location
    NYC
    MS-Off Ver
    Excel 2010 Professional Plus
    Posts
    44

    Recorded macro doesn't work 5 seconds after creation...

    Hello All,

    I recorded a macro to insert a pivot table on a Sheet "LEAS Pivot" within the same workbook as my data (Sheet "Data"). I finished the recording, saved the macro and Excel workbook, then deleted the newly created pivot table (deleted everything on the sheet, no residual left) and ran the recorded macro only to receive "Run-time error '5': Invalid procedure call or argument" for the following:

    Please Login or Register  to view this content.
    I'm in Excel 2010 with a brand new macro-enabled file and have successfully used this coding in multiple other macros. I did not edit anything within the macro between creation and re-run. Other macros in other files work just fine. A simple "hello world" macro in the troublesome workbook also works just fine. Please advise on what I'm doing wrong.

    Many thanks.
    Bjordion
    Attached Files Attached Files
    Last edited by Bjordion; 03-22-2013 at 04:48 PM. Reason: question solved

  2. #2
    Forum Expert judgeh59's Avatar
    Join Date
    02-07-2013
    Location
    Boise, Idaho
    MS-Off Ver
    Excel 2016
    Posts
    2,310

    Re: Recorded macro doesn't work 5 seconds after creation...

    does the Worksheet "LEAS Pivot" exist?
    Ernest

    Please consider adding a * if I helped

    Nothing drives me crazy - I'm always close enough to walk....

  3. #3
    Registered User
    Join Date
    10-05-2011
    Location
    NYC
    MS-Off Ver
    Excel 2010 Professional Plus
    Posts
    44

    Re: Recorded macro doesn't work 5 seconds after creation...

    Yes, spelling is correct and there are no additional spaces

  4. #4
    Forum Expert judgeh59's Avatar
    Join Date
    02-07-2013
    Location
    Boise, Idaho
    MS-Off Ver
    Excel 2016
    Posts
    2,310

    Re: Recorded macro doesn't work 5 seconds after creation...

    I have no idea....sorry about....I downloaded the file and tried a few things....recording my own macro and trying....I get the error...change from R1C1 format to A1 format, still get the error...changing the name of the pivottable...still get an error....changed the excel version, that didn't fix it....very strange....I'm curious to see what the fix is...hey, try this....create a new Data WS and record the macro on that....dont copy and paste....enter the data manually, I know it's a pain but maybe there is weird data in your data area....just a thought....

  5. #5
    Registered User
    Join Date
    10-05-2011
    Location
    NYC
    MS-Off Ver
    Excel 2010 Professional Plus
    Posts
    44

    Re: Recorded macro doesn't work 5 seconds after creation...

    Quote Originally Posted by judgeh59 View Post
    I have no idea....sorry about....I downloaded the file and tried a few things....recording my own macro and trying....I get the error...change from R1C1 format to A1 format, still get the error...changing the name of the pivottable...still get an error....changed the excel version, that didn't fix it....very strange....I'm curious to see what the fix is...hey, try this....create a new Data WS and record the macro on that....dont copy and paste....enter the data manually, I know it's a pain but maybe there is weird data in your data area....just a thought....
    Hey Judgeh59, thanks for trying. I already did what you're suggesting. My original data set is much larger. The sample I uploaded has been 100% manually typed in. I'm really at a loss as to what is causing this since other macros are still functioning.

  6. #6
    Forum Expert judgeh59's Avatar
    Join Date
    02-07-2013
    Location
    Boise, Idaho
    MS-Off Ver
    Excel 2016
    Posts
    2,310

    Re: Recorded macro doesn't work 5 seconds after creation...

    then I'm back to....I'll be very curious to see what the fix is....sorry I couldn't help....

  7. #7
    Forum Contributor
    Join Date
    01-13-2013
    Location
    Oklahoma
    MS-Off Ver
    Office 2007 / Office 2010
    Posts
    123

    Re: Recorded macro doesn't work 5 seconds after creation...

    It does not like the space in "LEAS Pivot". Lose the space and it works fine.

  8. #8
    Registered User
    Join Date
    10-05-2011
    Location
    NYC
    MS-Off Ver
    Excel 2010 Professional Plus
    Posts
    44

    Re: Recorded macro doesn't work 5 seconds after creation...

    Brilliant. That did the trick. Replaced with an underscore and I'm rolling along just fine.

  9. #9
    Forum Contributor
    Join Date
    01-13-2013
    Location
    Oklahoma
    MS-Off Ver
    Office 2007 / Office 2010
    Posts
    123

    Re: Recorded macro doesn't work 5 seconds after creation...

    It's the little things that can trip you up big time. Glad it's working for you now.

  10. #10
    Forum Expert judgeh59's Avatar
    Join Date
    02-07-2013
    Location
    Boise, Idaho
    MS-Off Ver
    Excel 2016
    Posts
    2,310

    Re: Recorded macro doesn't work 5 seconds after creation...

    @Yraen --- thanks from me also....that's one to keep in the back of your mind....WOW

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

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