Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7530151
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 30, 20262026-05-30T04:49:56+00:00 2026-05-30T04:49:56+00:00

I am trying to copy an excel sheet from one workbook to another without

  • 0

I am trying to copy an excel sheet from one workbook to another without the user seeing anything but I keep getting the error ‘Copy Method of Worksheet Class failed’. It seems you cant copy one sheet to another workbook unless the workbook is visible?

Thanks for any help.

Hers is the code that fails:

Private Sub CommandButton1_Click()

Dim xlapp As Excel.Application
Dim wkBook As Excel.Workbook

'Connect to Excel
Set xlapp = New Excel.Application

'Set workbook and open workbook in directory
Set wkBook = xlapp.Workbooks.Open(sFileName, xlUpdateLinksNever, ReadOnly:=False)


ThisWorkbook.Sheets("Logistics").Copy Before:=wkBook.Sheets(1)

wkBook.Close True
xlapp.Quit
Set xlapp = Nothing

End Sub
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-30T04:49:57+00:00Added an answer on May 30, 2026 at 4:49 am

    But I dont want the user to see the workbook opening and closing? Is there any way to copy from one workbook to another without the user seeing the workbook that is being copied to? Thanks – JC75

    I need to set the workbook to visible = false, but there is no visible property for the workbook. And if i set the application window to visible = false,I get the same orginal error of ‘Copy Method of Worksheet Class failed’ – JC75

    Another way to achieve what you want.

    '~~> From within excel
    Sub Sample()
        Dim wb1 As Workbook, wb2 As Workbook
        Dim ws1 As Worksheet
        Dim sFileName As String
    
        sFileName = "C:\Temp.xls"
    
        Set wb1 = ActiveWorkbook
        Set ws1 = wb1.Sheets("Logistics")
    
        Set wb2 = Workbooks.Open(sFileName)
        ActiveWindow.Visible = False
    
        wb2.Sheets.Add Before:=wb2.Sheets(1)
        ws1.Cells.Copy wb2.Sheets(1).Cells
    
        'Windows(wb2.Name).Visible = True
        wb2.Close SaveChanges:=True
    
        Set wb1 = Nothing
        Set wb2 = Nothing
    End Sub
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Basically, I'm trying to selectively copy a table from one database to another. I
Im trying to copy over data from one table to another in the same
So I am trying to copy alot of data from one woorkbook to another.
We are trying to copy a BO Query Service from one Universe to another.
I am trying to copy a database from one server to another in id
I'm trying to copy data from one Oracle schema ( CORE_DATA ) into another
I am trying to read one excel sheet and then creating another excel sheet
Im trying to copy and paste a table from excel into a word document.
I'm trying to copy one form <input> field value to another form using jQuery.
I'm trying to copy the values from a named range in Excel to a

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.