+ Reply to Thread
Results 1 to 2 of 2

Getting run-time error 1004: method 'undo' of object '_application' failed

Hybrid View

mso3 Getting run-time error 1004:... 05-02-2016, 08:03 AM
gmr4evr1 Re: Getting run-time error... 05-02-2016, 09:01 AM
  1. #1
    Forum Contributor
    Join Date
    06-29-2014
    Location
    India
    MS-Off Ver
    2010 Windows 10 64 bits
    Posts
    1,269

    Getting run-time error 1004: method 'undo' of object '_application' failed

    Hi friends,

    I want to restrict the manual entries in column ‘A’. I’m getting run-time error 1004: method ‘undo’ of object ‘_application’ failed

    Option Explicit
    
    Private Sub Worksheet_Change(ByVal Target As Range)
    
    'Restrict entry in column A
    
    If Target.Row < 2 Then
    With Application
    .ScreenUpdating = True
    .EnableEvents = True
    .Calculation = xlCalculationAutomatic
    End With
    Exit Sub
    ElseIf Target.Column = 1 Then
    Application.Undo
    MsgBox "Sorry! Please select title first. The PRN will be retrieve automatically.", 64
    Selection.Offset(, 1).Select
    With Application
    .ScreenUpdating = True
    .EnableEvents = True
    .Calculation = xlCalculationAutomatic
    End With
    Exit Sub
    End If
        
    End Sub
    Any help will be highly appreciated.

    Thanking you in anticipation.
    Sincerely,

    mso3

  2. #2
    Forum Expert gmr4evr1's Avatar
    Join Date
    11-24-2014
    Location
    Texas
    MS-Off Ver
    Office 2010 and 2007
    Posts
    3,448

    Re: Getting run-time error 1004: method 'undo' of object '_application' failed

    I don't get that error when I run your code. I did however notice something else...you have ScreenUpdating and EnableEvents set to true twice, the 1st ones should be set to false. Also, Calculation is set to automatic twice, the 1st one should be manual.
    1N73LL1G3NC3 15 7H3 4B1L17Y 70 4D4P7 70 CH4NG3 - 573PH3N H4WK1NG
    You don't have to add Rep if I have helped you out (but it would be nice), but please mark the thread as SOLVED if your issue is resolved.

    Tom

+ 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 '1004': Method 'Undo' of Object'_Application' failed
    By baig123 in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 11-20-2014, 02:21 AM
  2. Addon error : Run-time error '1004': Method 'MacroOptions' of object '_Application' failed
    By jtcoleman in forum For Other Platforms(Mac, Google Docs, Mobile OS etc)
    Replies: 3
    Last Post: 02-05-2014, 12:23 PM
  3. Run-time error '1004': Method 'Sheets' of object '_Global' failed
    By stigb in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 11-21-2013, 03:35 PM
  4. Run-Time error 1004 Method 'OnTime' of object '_Application' failed
    By PBM in forum Excel Programming / VBA / Macros
    Replies: 12
    Last Post: 08-29-2013, 10:00 PM
  5. [SOLVED] Run-time error 1004 - Method 'Range' of object'_Global' failed
    By onmyway in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 08-24-2013, 03:33 PM
  6. vba code returning Run Time Error 1004 method 'undo' of object
    By Ironman in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 10-24-2012, 08:17 PM
  7. Run time error 50290 method 'ontime' of object '_application' failed
    By newengwong in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 09-21-2012, 08:06 PM

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