+ Reply to Thread
Results 1 to 5 of 5

ActiveSheet.Paste Link:= True Does Not Work After Awhile - 1004 MS Excel cannot paste data

  1. #1
    Registered User
    Join Date
    06-25-2013
    Location
    Minnesota
    MS-Off Ver
    Excel 2010
    Posts
    10

    ActiveSheet.Paste Link:= True Does Not Work After Awhile - 1004 MS Excel cannot paste data

    I have written a large macro to take information across a variable number of rows and columns, copy each set of rows to a new appropriately named worksheet, then copy the values on the new worksheet so that the master list then contains links to the sub-worksheets. So, in other words, assume a file with 100 records comprised of 5 companies with 20 records per company. My macro creates 5 new worksheets - each with the name of the company. The information from the original worksheet is pasted into the respective worksheets. But then it is copied back to the original master spreadsheet as links. So if anyone updates anything on the 5 individual company spreadsheets it will automatically be saved to the master. Please note that this macro works just fine if I just do a simple pasting of values instead of a paste link.

    Below is my code. It works until it seems to poop out after x no. of records. [I have also attached the Excel file as well.]

    I tried a few ideas I found on the web such as disabling GoToMyPC or gotoassist - but I do not think I have either on my machine. I also experimented a bit with removing Select statements as well. I admit to being rusty with the VBA programming. Any suggestions are welcome and appreciated. Happy to be a part of the forum.

    Thank you.

    Zach Feinstein
    [email protected]
    <Code below>

    Sheets("Sheet1").Select
    ActiveSheet.Range(Cells(RowNum, 1), Cells(RowNum, LastCol + (Attempt * 3))).Select
    Selection.Copy
    Sheets(Left(CoName, 30)).Select
    Range("A1").Offset(CoRowNum - 1, 0).Select
    ActiveSheet.Paste
    Application.CutCopyMode = False

    Selection.Copy
    Sheets("Sheet1").Select
    ActiveSheet.Range(Cells(RowNum, 1), Cells(RowNum, LastCol + (Attempt * 3))).Select
    ActiveSheet.Paste Link:=True
    Application.CutCopyMode = False

    CoRowNum = CoRowNum + 1
    RowNum = RowNum + 1
    Loop
    Sheets("Sheet1").Select
    Range("A1").Select
    Attached Files Attached Files

  2. #2
    Valued Forum Contributor tehneXus's Avatar
    Join Date
    04-12-2013
    Location
    Hamburg, Germany
    MS-Off Ver
    Work: MS-Office 2010 32bit @ Win8 32bit / Home: MS-Office 2016 32bit @ Win10 64bit
    Posts
    944

    Re: ActiveSheet.Paste Link:= True Does Not Work After Awhile - 1004 MS Excel cannot paste

    Hi,

    check if this works for you, sorry for changing so much but you had a lot of selects there: Sample Disposition 06-25-13_edit.xlsm

    contains:
    Please Login or Register  to view this content.
    Please use [CODE]-TAGS
    When your problem is solved mark the thread SOLVED
    If an answer has helped you please click to give reputation
    Read the FORUM RULES

  3. #3
    Registered User
    Join Date
    06-25-2013
    Location
    Minnesota
    MS-Off Ver
    Excel 2010
    Posts
    10

    Re: ActiveSheet.Paste Link:= True Does Not Work After Awhile - 1004 MS Excel cannot paste



    Thank you so much for that code. I walked through the steps until it got through the main portion of populating the sheets. And it gets hung up in there somewhere. I will experiment some more in trying to figure out where it just sort of does not continue. I am re-attaching the Excel document again.

    Again, thank you very much for the help. I look forward to the final solution.
    Attached Files Attached Files

  4. #4
    Registered User
    Join Date
    06-25-2013
    Location
    Minnesota
    MS-Off Ver
    Excel 2010
    Posts
    10

    Re: ActiveSheet.Paste Link:= True Does Not Work After Awhile - 1004 MS Excel cannot paste

    Actually, the code works perfectly. Thank you so much. Z

  5. #5
    Valued Forum Contributor tehneXus's Avatar
    Join Date
    04-12-2013
    Location
    Hamburg, Germany
    MS-Off Ver
    Work: MS-Office 2010 32bit @ Win8 32bit / Home: MS-Office 2016 32bit @ Win10 64bit
    Posts
    944

    Re: ActiveSheet.Paste Link:= True Does Not Work After Awhile - 1004 MS Excel cannot paste

    Hi,

    does it crash on the sample file or another?
    Is there an error message?
    If yes whats the error code and the description?
    Can you debug it to find out in which codeline/row it happens?

    Make sure column F is not blank, otherwise you'll get error 1004: Application defined or object defined error.

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Tags for this Thread

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