|
-
March 16th, 2001, 02:46 PM
#1
How to check clipboard for data?
I'm writing an Excel macro and I was wondering that how can I check the clipboard wheter it's empty or not?
If the clibboard contains data then the macro will continue and paste the data to the Excel sheet...
Can anybody help?
-
March 16th, 2001, 03:17 PM
#2
Re: How to check clipboard for data?
If you want to do it manually you can run clipbrd.exe.
If you want to include this piece into your app, try the following
strClip=Clipboard.GetText
that will bring data from clipboard to the string Clip. No you can check if this string is empty or compare it with whatever you want
Iouri Boutchkine
[email protected]
-
March 16th, 2001, 03:34 PM
#3
Re: How to check clipboard for data?
I don't know much about VB objects. So can you tell me how do I define an object.
Your code gives the following error:
Run-time error '424:'
Object Required
-
March 16th, 2001, 03:44 PM
#4
Re: How to check clipboard for data?
I don't know what object gives you an error.
I just tested this code and everything was ok. Here is exactly the code that I was testing
Option Explicit
Private Sub Command1_Click()
Dim strClip As String
strClip = Clipboard.GetText
MsgBox strClip
End Sub
Iouri Boutchkine
[email protected]
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|