+ Reply to Thread
Results 1 to 10 of 10

Run-time error '6': Overflow

  1. #1
    Registered User
    Join Date
    01-12-2012
    Location
    USA
    MS-Off Ver
    Excel 2007
    Posts
    47

    Run-time error '6': Overflow

    When I run larger files of infomation in the below code I get the Run-time error '6': Overflow. The debugger goes to this line of code: "Sheets(cell.Value).Activate"

    The macro copy and pastes a lot of data, so I tried inserting "Application.CutCopyMode = False" but that is not fix it. I am not sure what to do to fix it the error.

    The macro is too long to be pasted in here, so I attached it as a txt file.

    Thanks.
    Attached Files Attached Files

  2. #2
    Forum Guru shg's Avatar
    Join Date
    06-20-2007
    Location
    The Great State of Texas
    MS-Off Ver
    2003, 2010
    Posts
    40,678

    Re: Run-time error '6': Overflow

    Whats the value in the cell when that happens?
    Entia non sunt multiplicanda sine necessitate

  3. #3
    Registered User
    Join Date
    01-12-2012
    Location
    USA
    MS-Off Ver
    Excel 2007
    Posts
    47

    Re: Run-time error '6': Overflow

    There are a bunch of cells selected when it happens, specifically E2:E261. The macro only runs up to E258 and the last 3 lines do no get run.

  4. #4
    Forum Expert
    Join Date
    07-16-2010
    Location
    Northumberland, UK
    MS-Off Ver
    Excel 2007 (home), Excel 2010 (work)
    Posts
    3,054

    Re: Run-time error '6': Overflow

    I think you're hitting the upper limit of the number of sheets allowed, but I'm puzzled as to why it throws the error when you activate the sheet, rather than when you create a copy of it.

  5. #5
    Registered User
    Join Date
    01-12-2012
    Location
    USA
    MS-Off Ver
    Excel 2007
    Posts
    47

    Re: Run-time error '6': Overflow

    I run the macro and it creates a new sheet and a pdf file at the same time. When I get to what would be the 65th pdf file I get the error.

  6. #6
    Forum Guru JosephP's Avatar
    Join Date
    03-27-2012
    Location
    Ut
    MS-Off Ver
    2003/10
    Posts
    7,328

    Re: Run-time error '6': Overflow

    I reckon maybe
    Please Login or Register  to view this content.

  7. #7
    Registered User
    Join Date
    01-12-2012
    Location
    USA
    MS-Off Ver
    Excel 2007
    Posts
    47

    Re: Run-time error '6': Overflow

    JosephP,

    Where do you think that I should insert that? Thanks.

  8. #8
    Forum Guru JosephP's Avatar
    Join Date
    03-27-2012
    Location
    Ut
    MS-Off Ver
    2003/10
    Posts
    7,328

    Re: Run-time error '6': Overflow

    It replaces the line where the error is happening now.

  9. #9
    Registered User
    Join Date
    01-12-2012
    Location
    USA
    MS-Off Ver
    Excel 2007
    Posts
    47

    Re: Run-time error '6': Overflow

    It stopped the error, and exported the correct number of files, but the 2 extra files that were created were just duplicates of file #64.

  10. #10
    Forum Guru JosephP's Avatar
    Join Date
    03-27-2012
    Location
    Ut
    MS-Off Ver
    2003/10
    Posts
    7,328

    Re: Run-time error '6': Overflow

    Can't see why that would be unless the sheets are the same, or the last cells have the same number in them.

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

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