Error Checking in Excel
Thanks Thanks:  0
Likes Likes:  0
Results 1 to 4 of 4

Thread: protecting clipboard contents

  1. #1
    New Member
    Join Date
    Apr 2002
    Posts
    7
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default

    Hi,

    I've got a VB6 application that takes data from an ADO recordset and copies it to an invisible Excel spreadsheet using the Windows clipboard. I've read that this is the fastest way to copy large datasets into an Excel worksheet. My problem is that while this application runs, my users are also using the Windows clipboard in other applications. Thus they can inadvertently change the contents that are pasted into the hidden spreadsheet or are surprised when the data that they are manually pasting is changed to the data that's destined for the spreadsheet. Am I forced to give up on using the clipboard for this data transfer or is there a way of protecting the clipboard contents? Thanks in advance.

    Bill


    [ This Message was edited by: billsox on 2002-04-07 18:54 ]

  2. #2
    Rest in Peace
    Join Date
    Feb 2002
    Posts
    1,582
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default

    Hi Bill

    You have been mislead somewhat, the fastest way (if possible) is to bypass the clipboad altogether. EG

    Sheet1.Range("A1:100").Copy Destination:= Sheet2.Range("A65536").end(xlup)

    Of course, I am not sure if this can be used in your specific intstance?






  3. #3
    New Member
    Join Date
    Apr 2002
    Posts
    7
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default

    On 2002-04-07 19:27, Dave Hawley wrote:
    Hi Bill

    You have been mislead somewhat, the fastest way (if possible) is to bypass the clipboad altogether. EG

    Sheet1.Range("A1:100").Copy Destination:= Sheet2.Range("A65536").end(xlup)

    Of course, I am not sure if this can be used in your specific intstance?

    I think it can. If my VB6 app saves the recordset to a temporary csv file and then loads that file into Excel, your code can take it from there. I just hope the temp file solution doesn't slow things down too much.

    Bill

  4. #4
    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

    Just curious why you need a middle man on this one? Why not send it straight to Excel?
    Tom

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
  •