Results 1 to 2 of 2

Why the paste method failed?

Threaded View

  1. #1
    Forum Contributor
    Join Date
    08-01-2016
    Location
    China, beijing
    MS-Off Ver
    2016
    Posts
    114

    Why the paste method failed?

    This is the code I use . First I copyt the content which I want. And then run the macro below, but it pops out a error that class worksheet invalid paste method. Why is that?

    Sub saveNewFile()
    '
    ' saveNewFile 宏
    '
    
    '
        Dim ws As Worksheet
        With ThisWorkbook
            Set ws = .Sheets.Add(After:=.Sheets(.Sheets.Count))
            ws.Name = "TodaySheet"
        End With
        
        ActiveSheet.Paste Destination:=Sheets("TodaySheet").Range("A1:R100")
        
        Application.CutCopyMode = False
        ActiveWorkbook.Save
        ActiveSheet.Select
        ActiveSheet.Move
        
        Sheets("TodaySheet").Columns.AutoFit
        
        ArrangeDate = DateAdd("d", 1, Date)
        
        ActiveWorkbook.SaveAs Filename:= _
            "C:\Users\Administrator\Desktop\" & ArrangeDate & "发货.xlsm", FileFormat:= _
            xlOpenXMLWorkbookMacroEnabled, CreateBackup:=False
            
    End Sub
    Attached Files Attached Files

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Method 'Paste' of object'_Worksheet' failed :(
    By morerockin in forum Excel General
    Replies: 14
    Last Post: 05-16-2015, 09:27 PM
  2. When Activesheet.paste, Run-Time error '1004': Paste method of work sheet class failed.
    By devaraj2020 in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 03-27-2015, 01:59 AM
  3. Paste Method of Worksheet Class Failed
    By jacobadger in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 10-18-2012, 10:41 AM
  4. paste method of worksheet failed
    By Theodjinn in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 08-26-2008, 07:36 AM
  5. Paste method of worksheet class failed
    By Hobnob in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 08-17-2007, 08:03 AM
  6. [SOLVED] [SOLVED] Paste Method failed (Activesheet.Paste)
    By MS Excel in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 10-13-2005, 10:05 AM
  7. Method 'Paste' of object '_Worksheet' failed
    By markline in forum Excel General
    Replies: 7
    Last Post: 05-28-2005, 12:02 AM

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