Consulting

Results 1 to 4 of 4

Thread: How do I preserve the user's Clipboard while he's accessing my form?

  1. #1

    How do I preserve the user's Clipboard while he's accessing my form?

    Users of a program often don't want their Clipboard messed with while they're interacting with a userform, but the form still needs to copy things internally to perform it's function. I found some halfhearted solutions that involve saving the Clipboard contents to a file, or to a cell, or to internal memory and then restoring afterwards, but that seems totally unworkable to me because how do you know when "afterwards" is. It would have to be after every keystroke or mouse click to be totally transparent to the user.

    I thought the Office Clipboard might be a way out, but everything I can find on that says it's not accessible by VBA. So, how do other people do it? Or is it not possible.

  2. #2
    Could you tell me why you need to use the clipboard in the userform's code? You can access all information you need directly from its object model.
    Regards,

    Jan Karel Pieterse
    Excel MVP jkp-ads.com

  3. #3
    Hi Jan, I'm using Stephen Bullen's PastePicture, which requires that the picture be on the clipboard to start with.

  4. #4
    OK, gotcha.
    I guess the "half-hearted" solution IS the only alternative. I'd restore the clipboard immediately after issuing your last pastepicture command, since your used might have put something on the clipboard he wants to paste into the form itself.
    Regards,

    Jan Karel Pieterse
    Excel MVP jkp-ads.com

Posting Permissions

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