+ Reply to Thread
Results 1 to 5 of 5

Copy and Paste from one workbook to another not working

  1. #1
    Forum Expert darkyam's Avatar
    Join Date
    03-05-2008
    Location
    Houston, TX
    MS-Off Ver
    2013
    Posts
    2,191

    Copy and Paste from one workbook to another not working

    Hi, all,
    I have an Access database that pulls up reports in Excel. I need a bunch of these reports to pull up another one-page workbook, copy in the data from A:K to a sheet with the same name on the report, then close the one-page workbook without saving. The problem is that, while the report (second function) runs, it doesn't seem to be doing anything with the first function. I would be very grateful for any help.
    Please Login or Register  to view this content.
    Life is about perseverance. Remember: today's mighty oak tree is just yesterday's nut that held its ground.

    If you like a post, please rate it with the scales icon (top right).
    If you feel really indebted, please consider a donation to charity, such as Feed the Children or Habitat for Humanity.

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

    Re: Copy and Paste from one workbook to another not working

    1. But these are not functions, just the usual/ordinary "Sub" procedures ?
    2. Missing 'Set xlApp', without 'Set' when deklaration is 'Dim xlApp As New Excel.Application'
    3. "xlCoDivDepSheet" - this is missing in the code, in addition to the declaration
    4. Missing 'Set xlBook'

  3. #3
    Forum Expert darkyam's Avatar
    Join Date
    03-05-2008
    Location
    Houston, TX
    MS-Off Ver
    2013
    Posts
    2,191

    Re: Copy and Paste from one workbook to another not working

    Thanks for your reply. Unfortunately, I didn't write most of this code and I've never gotten good with VBA. I'm trying to modify what I was left to suit my purposes. For 2 and 3, I don't understand what the declaration is supposed to actually be. For 4, I need it to be whatever xlBook is in the sub that is calling the first sub. Is there a way to do that or would that happen automatically if not declared? Thanks for your help.

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

    Re: Copy and Paste from one workbook to another not working

    Try, maybe this way ?
    Please Login or Register  to view this content.

  5. #5
    Forum Expert darkyam's Avatar
    Join Date
    03-05-2008
    Location
    Houston, TX
    MS-Off Ver
    2013
    Posts
    2,191

    Re: Copy and Paste from one workbook to another not working

    Since I have to put this in literally over a dozen places, I was hoping there was a way to just call it in. If there's not, though, I understand. I'll just revert back to the way it was and start copying it over. Thanks for your time, though.

+ 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. Macro to paste formatting only Excel 2013 - not working from workbook to workbook
    By LindyParsnips in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 02-05-2016, 08:32 AM
  2. [SOLVED] Help! Copy row from one workbook and paste into last row of another workbook not working
    By Jo2710 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 09-18-2014, 05:24 PM
  3. Copy paste - cute paste macro almost working
    By graiggoriz in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 08-27-2014, 12:33 PM
  4. Replies: 6
    Last Post: 03-26-2014, 11:40 PM
  5. [SOLVED] Open new workbook, copy and paste not working
    By cheeze83 in forum Excel Programming / VBA / Macros
    Replies: 27
    Last Post: 11-21-2013, 04:55 AM
  6. Replies: 2
    Last Post: 08-17-2012, 08:16 AM
  7. Replies: 2
    Last Post: 03-27-2012, 02:49 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