Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How do you clear the clipboard in VBA ? 3

Status
Not open for further replies.

BuilderSpec

Programmer
Dec 24, 2003
383
GB
Well that's it really.. copying and pasting a record that is big, when I come out of the form it keeps asking me if I want to keep the data on the clipboard ? I don't but i don't want it to ask me every time. Is there not some code that I can run that will clear the clipboard before I leave the form?

Regards

BuilderSpec
 
Have you tried to copy empty stuff in the clipboard before leaving the form ?

Hope This Help, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884
 
Did you or anyone find a resolution to this problem. I am having the same problem.
 
Have you tried using the EmptyClipboard API?

Good Luck
--------------
As a circle of light increases so does the circumference of darkness around it. - Albert Einstein
 
First thing you need to do is to declare the following APIs in the declarations section of a Code Module.
Code:
Private Declare Function OpenClipboard Lib "user32" (ByVal hwnd As Long) As Long
Private Declare Function CloseClipboard Lib "user32" () As Long
Private Declare Function EmptyClipboard Lib "user32" () As Long
Then, from inside some method of your form, execute the following three lines of code.
Code:
OpenClipboard Me.hwnd
EmptyClipboard
CloseClipboard

Good Luck
--------------
As a circle of light increases so does the circumference of darkness around it. - Albert Einstein
 
One update, change the "Private" to "Public" in the three API declarations.

Good Luck
--------------
As a circle of light increases so does the circumference of darkness around it. - Albert Einstein
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top