Error Checking in Excel
Thanks Thanks:  0
Likes Likes:  0
Page 3 of 3 FirstFirst 123
Results 21 to 24 of 24

Thread: Copy Method of Worksheet Fails

  1. #21
    MrExcel MVP Ivan F Moala's Avatar
    Join Date
    Feb 2002
    Location
    Auckland, New Zealand
    Posts
    4,209
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default

    On 2002-05-11 22:33, TsTom wrote:
    The other one is wrong...
    This worked for 524 sheets copied.
    Total of 527 with the default three.
    I stopped it after that.
    I thought you could only have 256 sheets in one workbook?



    Public Declare Function GetActiveWindow Lib _
    "user32" () As Long
    Public Declare Function OpenClipboard Lib _
    "user32" (ByVal hwnd As Long) As Long
    Public Declare Function EmptyClipboard Lib _
    "user32" () As Long
    Public Declare Function CloseClipboard Lib _
    "user32" () As Long

    Sub TryThis()
    Dim cnt
    For cnt = 1 To 1000
    Sheets("Sheet1").Copy After:=Sheets(3)
    Call OpenClipboard(GetActiveWindow())
    Call EmptyClipboard
    Call CloseClipboard
    Next
    End Sub

    Tom worksheet# is limited by the amount of
    memory.....

    Your code looks good and explains a few things with excel...I don't think excel
    uses the windows Copy API's in fact I think
    excel copies over info in it's own format
    Your code sought of proves this.
    I'll try it @ home now...

    Thanks for the code.

    Kind Regards,
    Ivan F Moala From the City of Sails

  2. #22
    New Member
    Join Date
    May 2002
    Location
    New Jersey
    Posts
    23
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default

    Tom,
    That 255 worksheet thing is the number Excel allows you to set the default number of sheets in a new workbook at. After that you can insert them as usual.

  3. #23
    Board Regular
    Join Date
    Mar 2002
    Location
    Cincinnati, Ohio, USA
    Posts
    6,824
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default

    Oh, Ok.
    Thanks CompTuter

  4. #24
    Board Regular detangler's Avatar
    Join Date
    Oct 2003
    Location
    California
    Posts
    74
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default Re: Copy Method of Worksheet Fails

    This is good information since I just ran into the exact same problem. I have not tried the solutions posted here yet but I want to update the link to the MS article that Ivan posted:

    http://support.microsoft.com/default...b;en-us;210684

    Also, it might just be easier to search by article ID 210684 on the MS Knowledge Base should this link stop working in the future.

Some videos you may like

User Tag List

Like this thread? Share it with others

Like this thread? Share it with others

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •