Results 1 to 11 of 11

Thread: Pls Help Clipboard.Clear Not clearing the clipboard

  1. #1

    Thread Starter
    Member
    Join Date
    Jan 2007
    Posts
    63

    Question Pls Help Clipboard.Clear Not clearing the clipboard

    Hail to All,

    Ok here is the problem I am having. Clipboard.Clear it not clearing the clipboard on all machines my program is run on. Most machines it works fine. Other still have what was previously copied. Here is a test I run.

    one button has
    Clipboard.Clear
    Clipboard.SetText "This is a test"


    the other button has
    Clipboard.Clear
    Clipboard.SetText "This is the second test"

    Now they go to a blank document of some type notepad word or an e-mail program and hit ctrl-V and it pastes what was previously in the cipboard even though I cleared it. Now if they go to a program like word and manual clear the clipboard they can click button one and it pastes 'This is a test' they then click the second button and it pastes the same text that is in the first button because the clipboard for some reason is not cleared. So, they are having to manually clear the clipboard each time.

    Anyone have any ideas?

    Thanks for all your help.


    Mythos

  2. #2
    I'm about to be a PowerPoster! Hack's Avatar
    Join Date
    Aug 2001
    Location
    Searching for mendhak
    Posts
    58,333

    Re: Pls Help Clipboard.Clear Not clearing the clipboard

    Quote Originally Posted by Mythos44
    Ok here is the problem I am having. Clipboard.Clear it not clearing the clipboard on all machines my program is run on. Most machines it works fine. Other still have what was previously copied.
    There is seldom a clear cut answer to problems like these.

    Lets start with the machines.

    Does this behavior consistently happen on the machines it is not clearing on? I.E., does it never, ever clear, or, even on these machines, does it clear sometimes?

    What are the differences in the machines that it works on and those that it does not work on? Brand Names? OS version? Service Pack Level?

    Do the machines that it does not clear on run software that the others do not?

  3. #3

    Thread Starter
    Member
    Join Date
    Jan 2007
    Posts
    63

    Question Re: Pls Help Clipboard.Clear Not clearing the clipboard

    they are all suposed to be identical machines with identical software. I did find an instance if they had a program called printkey2000 open it couldn't clear the clipboard so we can get around that. Though I thought it should clear the clipboard no matter what seeing as that is what the code is suposed to do. is there any other way to force the clipboard to clear seeing as MS Word is able to do this.

    Thanks again,

    Mythos

  4. #4
    I'm about to be a PowerPoster! Hack's Avatar
    Join Date
    Aug 2001
    Location
    Searching for mendhak
    Posts
    58,333

    Re: Pls Help Clipboard.Clear Not clearing the clipboard

    MS Word is not written in Visual Basic.

    Clipboard.Clear is the only VB way I'm familiar with.

  5. #5
    I'm about to be a PowerPoster! Hack's Avatar
    Join Date
    Aug 2001
    Location
    Searching for mendhak
    Posts
    58,333

    Re: Pls Help Clipboard.Clear Not clearing the clipboard

    Just for giggles, I just tried this and it seemed to work (but, Clipboard.Clear also works without any problems for me and on all of the machines on which I have apps deployed)

    Give it shot and see what happens.
    Code:
    Clipboard.Clear
    Clipboard.SetText vbNullString

  6. #6

    Thread Starter
    Member
    Join Date
    Jan 2007
    Posts
    63

    Smile Re: Pls Help Clipboard.Clear Not clearing the clipboard

    Ok this does still does not clear the clipboard though the string is now added and when they hit ctrl-v it adds the latest string. So it's not 100% but it will do. Thanks so much for your help. It is greatly appreciated.


    Mythos

  7. #7
    I'm about to be a PowerPoster! Hack's Avatar
    Join Date
    Aug 2001
    Location
    Searching for mendhak
    Posts
    58,333

    Re: Pls Help Clipboard.Clear Not clearing the clipboard

    You should continue your investigation in an attempt to find out what is going on with those few machines.

    If you do find the issue, post back what it was and what you did.

  8. #8
    PowerPoster
    Join Date
    Feb 2006
    Location
    East of NYC, USA
    Posts
    5,691

    Re: Pls Help Clipboard.Clear Not clearing the clipboard

    The computers it's not working on aren't running a Clipboard manager of any sort, are they?
    The most difficult part of developing a program is understanding the problem.
    The second most difficult part is deciding how you're going to solve the problem.
    Actually writing the program (translating your solution into some computer language) is the easiest part.

    Please indent your code and use [HIGHLIGHT="VB"] [/HIGHLIGHT] tags around it to make it easier to read.

    Please Help Us To Save Ana

  9. #9
    I'm about to be a PowerPoster! Hack's Avatar
    Join Date
    Aug 2001
    Location
    Searching for mendhak
    Posts
    58,333

    Re: Pls Help Clipboard.Clear Not clearing the clipboard

    Like what, for instance? (I'm not familiar with Clipboard managers.)

  10. #10
    PoorPoster iPrank's Avatar
    Join Date
    Oct 2005
    Location
    In a black hole
    Posts
    2,729

    Re: Pls Help Clipboard.Clear Not clearing the clipboard

    Like MS-Office clipboard manager (multiple copy/paste history) but works with windows clipboard.
    Usefull VBF Threads/Posts I Found . My flickr page .
    "I love being married. It's so great to find that one special person you want to annoy for the rest of your life." - Rita Rudner


  11. #11
    Junior Member
    Join Date
    Apr 2007
    Posts
    18

    Re: Pls Help Clipboard.Clear Not clearing the clipboard

    Ive had a similar problem where we would clear the clipboard, but it would still error out saying its full if the next line attempted to add to it. DoEvents after the clear took care of it, may be worth a try.

Posting Permissions

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



Click Here to Expand Forum to Full Width