+ Reply to Thread
Results 1 to 2 of 2

Runt time error 1004 Method "Copy of object'_Worksheet failed"

  1. #1
    Registered User
    Join Date
    04-13-2016
    Location
    Pune
    MS-Off Ver
    MS office 2010
    Posts
    0

    Runt time error 1004 Method "Copy of object'_Worksheet failed"

    Hi All,

    Please help me on this error of copy of object_Worksheet failed"

    PFA below codes.

    Sub CombineFiles()

    Dim Path As String
    Dim FileName As String
    Dim Wkb As Workbook
    Dim Ws As Worksheet
    Dim wscount As String

    Application.EnableEvents = False
    Application.ScreenUpdating = False

    Path = "D:\Premium Register" FileName = Dir(Path & "\*.xlsx", vbNormal)
    Do Until FileName = ""
    Set Wkb = Workbooks.Open(FileName:=Path & "\" & FileName)
    For Each Ws In Wkb.Worksheets
    Ws.Copy After:=ThisWorkbook.Sheets(ThisWorkbook.Sheets.Count)

    Next Ws
    Wkb.Close False
    FileName = Dir()
    Loop
    Application.EnableEvents = True
    Application.ScreenUpdating = True
    End Sub

  2. #2
    Registered User
    Join Date
    09-09-2011
    Location
    Bangalore, India
    MS-Off Ver
    Excel 2003 & 2007
    Posts
    19,164
    Hello mohansoft,

    Welcome to Excelforum. Be a part of large Excel community. Enjoy Learning.
    If I have helped, Don't forget to add to my reputation (click on the star below the post)
    Don't forget to mark threads as "Solved" (Thread Tools->Mark thread as Solved)
    Use code tags when posting your VBA code: [code] Your code here [/code]

+ 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 Method 'Visible' of Object "_Worksheet' failed
    By Sorjas in forum Excel Programming / VBA / Macros
    Replies: 12
    Last Post: 07-15-2015, 02:29 AM
  2. Run-Time Error '1004': Method 'Visible' of Object'_Worksheet' Failed
    By caltman242 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 03-14-2015, 10:43 AM
  3. run-time error '1004' method 'range' of object '_worksheet' failed
    By Emma_B in forum Excel Programming / VBA / Macros
    Replies: 9
    Last Post: 08-26-2014, 09:00 AM
  4. [SOLVED] Run-time error '1004': Method 'Select' of object'_Worksheet' failed
    By vbiggs101 in forum Excel Programming / VBA / Macros
    Replies: 10
    Last Post: 08-07-2013, 02:56 PM
  5. Run time Error 1004 Method 'Range' object '_Worksheet 'failed
    By Monica1 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 07-24-2013, 07:42 AM
  6. me too - run-time error '1004' method 'range' of object '_worksheet' failed
    By ASAFSWIS in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 04-07-2013, 05:14 PM
  7. What is Error "Method "Paste" of object "_Worksheet" failed?
    By vat in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 02-17-2006, 04:10 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