Emptying the Office Clipboard

  • Thread starter Thread starter roybrew
  • Start date Start date
R

roybrew

Anyone know how to empty or clear the contents of the Office Clipboard?
I am using a bunch of .CopyPicture/.PasteFace calls to build toolbar
buttons and would like to clean up after myself when I am done. Can't
seem to find a method to do this and attempts to just clear the Windows
Clipboard don't seem to do it. Any info would be appreciated.

thanks,

Roy
 
Roy,

In my experience, the pasteface method is very buggy in versions of Excel
prior to 2002 (XP). I have even gone so far as to force text only toolbars
in early versions in annoyance at the problem.

In theory you can clear the clipboards using application.cutcopymode = false
but this does not appear to have any effect when working either with the
pasteface method or when copying charts as pictures, to the extent that I
believe Excel is using a separate and private clipboard that is not
documented and not accessible to the VBA programmer.

One other suggestion is to copy a cell on the sheet to try and reset the
clipboard but that seems to have little effect. As you have I've tried
clearing the windows clipboard using api calls too and that doesn't help
either.

Not much help really, but you are not alone with the problem.

Robin Hammond
www.enhanceddatasystems.com
 
Robin,

Thanks for the reply. It confirms my suspicions as well. I had
thought that this "new" Office Clipboard was a little smoke and
mirrors. Kind of odd to not allow folks programmable access, though --
at least something to clear it. I haven't seen too many problems with
..PasteFace -- that seems to be ok, with the exception of the "trash" it
leaves on the office clipboard. Good programming practices preach good
garbage collection -- but not so in this case. Thanks again
Roy
 
Roy,

You're welcome. I'd just make sure you have error traps around the PasteFace
method and an option for text toolbars just in case you run into that
machine that inexplicably struggles with the method. I've seen it often
enough to know it's an issue. Same thing with CopyPicture.

Robin Hammond
www.enhanceddatasystems.com
 
Back
Top