+ Reply to Thread
Results 1 to 2 of 2

Prompting user with MsgBox IF runtime error 1004

  1. #1
    Registered User
    Join Date
    10-27-2012
    Location
    Uk
    MS-Off Ver
    Excel 2010
    Posts
    98

    Question Prompting user with MsgBox IF runtime error 1004

    Hi All

    This sounds like it should be simple but I am stuck

    I have a script that loops through certain sheets and collates all the pivot table rows

    Because the pivot cache is turned off (to save file space as the source data is always saved in the workbook) the user gets runtime error 1004 if they open the workbook and try to call any macros containing ActiveSheet.PivotTables(1) before refreshing the data

    So I wanted to add a bit of error handing. Something like this:

    Please Login or Register  to view this content.
    But now I'm getting run time error 424 - object required?
    (The above code is inside a FOR loop if the makes a difference?)

    Any/all advice welcome
    Many thanks
    Vicky

  2. #2
    Registered User
    Join Date
    10-27-2012
    Location
    Uk
    MS-Off Ver
    Excel 2010
    Posts
    98

    Re: Prompting user with MsgBox IF runtime error 1004

    Oh jeez, it was simple

    I changed Error.Number to Err.Number and it worked

    Thread closed

+ 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. [SOLVED] Runtime Error 1004 + Runtime 5
    By jrean042 in forum Excel Programming / VBA / Macros
    Replies: 9
    Last Post: 07-07-2020, 08:16 AM
  2. VBA error: runtime error 1004 : Method range of object - 'Global' failed.
    By Afjio12 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 02-28-2019, 04:37 AM
  3. [SOLVED] Msgbox Code - VBA 2016 - Runtime Error
    By RAFA_NADAL in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 11-27-2018, 11:09 PM
  4. Runtime error '1004': Paste special method of range class error.
    By Daryl Zer0 in forum Excel Programming / VBA / Macros
    Replies: 11
    Last Post: 11-05-2014, 01:44 AM
  5. [SOLVED] Runtime 1004 after prompting for filename but not when filename hard coded.
    By cgoodenough in forum Excel Programming / VBA / Macros
    Replies: 8
    Last Post: 12-04-2013, 03:46 AM
  6. [SOLVED] VBA Error: Runtime Error 1004: AutoFilter method of Range class failed
    By jl22stac in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 10-03-2013, 07:27 PM
  7. [SOLVED] Range error in code, runs alone but not inside my full program, giving runtime error 1004
    By charizzardd in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 08-23-2012, 03:34 PM

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