CLEARING THE CLIPBOARD !!!

J

jay dean

Hi - I am using Chip Pearson's code below to clear the clipboard. I have
assigned it to a form's command control and when I compile, I get "Only
comments may appear after End Sub, End Function, or End property."

What am I doing wrong? Below is how I am using the code:

Private Sub CommandButton2_Click()

Private Declare Function OpenClipboard Lib "user32" (ByVal hwnd As Long)
As Long
Private Declare Function EmptyClipboard Lib "user32" () As Long
Private Declare Function CloseClipboard Lib "user32" () As Long

''''Sub ClearClipboard()
OpenClipboard (0&)
EmptyClipboard
CloseClipboard
''''End Sub

End Sub




*** Sent via Developersdex http://www.developersdex.com ***
 
R

Rick Rothstein

Those Declare statements cannot be placed inside of a Sub (or Function)
procedure... they must go in the <General><Declaration> section of the code
window (look at the two drop down boxes at the top of the code window) and,
if there were any constants (Const statements) associated with the Declare
statements, they too should go in the <General><Declaration> section of the
code window as well.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top