Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 154
Default CLEARING THE CLIPBOARD !!!


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 ***
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,934
Default CLEARING THE CLIPBOARD !!!

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.

--
Rick (MVP - Excel)


"jay dean" wrote in message
...

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 ***


  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 154
Default CLEARING THE CLIPBOARD !!!

Thank you, Rick. It was exactly what I had to do!!
Thanks, r.

Jay

*** Sent via Developersdex http://www.developersdex.com ***
  #4   Report Post  
Posted to microsoft.public.excel.programming
r r is offline
external usenet poster
 
Posts: 125
Default CLEARING THE CLIPBOARD !!!


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

Private Sub CommandButton2_Click()

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

End Sub

regards
r

Il mio ultimo lavoro ...
http://excelvba.altervista.org/blog/...ternative.html


"jay dean" wrote:


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 ***

Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
clearing the clipboard [email protected] Excel Discussion (Misc queries) 2 April 25th 07 09:11 AM
Clearing the clipboard Avi Excel Programming 4 November 18th 05 01:08 PM
Clearing the clipboard Greg Billinge Excel Programming 2 September 2nd 05 01:19 PM
Clearing Clipboard Patrick[_7_] Excel Programming 1 September 28th 04 01:36 PM
clearing the clipboard mike Excel Programming 1 March 4th 04 08:34 PM


All times are GMT +1. The time now is 05:42 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"