+ Reply to Thread
Results 1 to 5 of 5

Worksheet Being Copied To Wrong Workbook

  1. #1
    Forum Contributor
    Join Date
    06-15-2009
    Location
    Ontario, canada
    MS-Off Ver
    Office 365
    Posts
    371

    Worksheet Being Copied To Wrong Workbook

    Please Login or Register  to view this content.
    This code is within active workbook 1, worksheet 1. I wish to make a copy of ws_stsked in hidden workbook 2 (aka wb_sschedule) into that same workbook and call it "staff_schedule_copy".

    This code is placing the copy into workbook 1, not workbook 2.

    How do I copy into the proper workbook 2?

  2. #2
    Forum Expert
    Join Date
    10-06-2017
    Location
    drevni ruchadlo
    MS-Off Ver
    old
    Posts
    2,151

    Re: Worksheet Being Copied To Wrong Workbook

    Try:
    Please Login or Register  to view this content.
    , but what do you mean by the term "hidden workbook 2" ?
    Last edited by mjr veverka; 03-30-2019 at 04:02 PM.

  3. #3
    Forum Contributor
    Join Date
    06-15-2009
    Location
    Ontario, canada
    MS-Off Ver
    Office 365
    Posts
    371

    Re: Worksheet Being Copied To Wrong Workbook

    Hi porucha vevrku, thank you for your reply.

    The only line I felt I needed to change was to this ...
    [/code].Copy After:=wb_sschedule.Worksheets(wb_sschedule.Sheets.Count)[/code]
    which now results in an error ... "Method of object '_Worksheet' failed."

    what do you mean by the term "hidden workbook 2" ?
    meaning it is open, but not visible.

    wb_sschedule is recognized, as is ws_stsked is also recognized.

  4. #4
    Forum Expert
    Join Date
    10-06-2017
    Location
    drevni ruchadlo
    MS-Off Ver
    old
    Posts
    2,151

    Re: Worksheet Being Copied To Wrong Workbook

    ... but the workbook itself is invisible for certain operations, especially those with the prefix "active" ...
    Please Login or Register  to view this content.

  5. #5
    Forum Contributor
    Join Date
    06-15-2009
    Location
    Ontario, canada
    MS-Off Ver
    Office 365
    Posts
    371

    Re: Worksheet Being Copied To Wrong Workbook

    Perfect. I have to expose the workbook (ie visible = true) before I can copy to it.
    Thank you!

+ 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. Need copied web workbook to overwrite to a worksheet
    By cdtouchberry in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 01-30-2019, 10:31 AM
  2. Copying worksheet to other workbook image is not copied to other workbook
    By meneertjebeertje in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 08-17-2018, 04:13 AM
  3. Data will be copied from a separate workbook to worksheet RawData in another workbook
    By pghpens44 in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 01-13-2014, 10:07 AM
  4. Copying multiple worksheet so that copied hyperlinks link to new copied sheets
    By chrisjames25 in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 03-01-2013, 02:37 PM
  5. info/data transferred/copied from worksheet to worksheet in same workbook!
    By joe dech in forum Excel Programming / VBA / Macros
    Replies: 13
    Last Post: 01-17-2012, 02:53 PM
  6. Importing data from worksheet to be copied in another workbook
    By klowjet in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 12-13-2010, 10:49 AM
  7. [SOLVED] I copied a workbook to a CD. I can only access 1 worksheet.
    By Bob Jachim in forum Excel General
    Replies: 0
    Last Post: 02-13-2006, 09:20 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