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 Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

empty clipboard 1

Status
Not open for further replies.

ninash

Technical User
Jul 6, 2001
163
GB
Hi everyone and hope you all have a great new year

I am importing data into excel workbooks.
When I close the books I get an annoying message box telling me that there is a large amount of data in the clipboard and do I want to save it for later use.
I never want to use it and was wondering it there was any way of answering the No to it without having to click the button

Thanks in advance
 
Hi Ninash,

I've had to do this recently, and found the code somewhere on the web. Try putting the following into a VBA module or at the end of an existing macro:

[tt]
Dim clearClip As DataObject
Set clearClip = New DataObject
clearClip.SetText ""
clearClip.PutInClipboard
[/tt]

Where clearClip can be any variable name, and the rest is required code.

This replaces whatever is on the clipboard with a null string, which has the effect of clearing it.

Good luck, SB.
 
Hi,
The place to put that code is in the Workbook object Close event. Skip,
metzgsk@voughtaircraft.com
 
Thanks Steve
Just when I was thinking I was going to have to keep on clicking that stupid button instead of getting on with more work you have come up trumps for me.
 
Office 2000 did not hagle the code listed above very well. It gave me an error about user defined objects. Is there anything elese I need besides that code. The dataObject seem to give it the trouble.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top