-
Nov 21st, 2005, 01:27 PM
#1
Thread Starter
Fanatic Member
-
Nov 21st, 2005, 01:29 PM
#2
Re: Copy to Clipboard error
Try Clipboard.Clear every few iterations.
-
Nov 21st, 2005, 01:30 PM
#3
Re: Copy to Clipboard error
 Originally Posted by timeshifter
Try Clipboard.Clear every few iterations.
Yep, I think you may be clogging up the clipboard.
-
Nov 21st, 2005, 01:31 PM
#4
Re: Copy to Clipboard error
 Originally Posted by timeshifter
Try Clipboard.Clear every few iterations.
not every few..every time you are going to change it, clear it.
-
Nov 21st, 2005, 01:32 PM
#5
Re: Copy to Clipboard error
that would be a good idea, wouldn't it? No confusion when getting stuff from it... Why didn't I think of that?
-
Nov 21st, 2005, 01:42 PM
#6
Thread Starter
Fanatic Member
Re: Copy to Clipboard error
I figured as much... just wanted to check with ya'll since I'm new to using the clipboard in my app.
You guys are the best! Thanks!
-
Nov 21st, 2005, 04:13 PM
#7
Thread Starter
Fanatic Member
Re: Copy to Clipboard error - NOT RESOLVED
Before I copy anything to the clipboard, I run Clipboard.Clear.. and I still get this error... ANy Ideas?
In Fact, here is the code:
VB Code:
Clipboard.Clear
Clipboard.SetText RemindMe.List1.Text
RemindMe.Text1.SetFocus
-
Nov 21st, 2005, 04:33 PM
#8
Re: Copy to Clipboard error - NOT RESOLVED
According to MSDN, this error means that the Clipboard has already been opened by another application.
HTH
Pete
No trees were harmed in the making of this post, however a large number of electrons were greatly inconvenienced.
-
Nov 21st, 2005, 04:43 PM
#9
Hyperactive Member
Re: Copy to Clipboard error - NOT RESOLVED
What routine do you call that in? I can't re-create your error.
-
Nov 21st, 2005, 04:44 PM
#10
Thread Starter
Fanatic Member
Re: Copy to Clipboard error - NOT RESOLVED
is there any way to "close" the clipboard before i send the data to the clipboard?
-
Nov 21st, 2005, 05:59 PM
#11
Re: Copy to Clipboard error - NOT RESOLVED
 Originally Posted by mateo107
is there any way to "close" the clipboard before i send the data to the clipboard?
Not that I'm aware of. Maybe the best solution would be to just trap the error and carry on
VB Code:
Option Explicit
Private Declare Sub Sleep Lib "kernel32.dll" (ByVal dwMilliseconds As Long)
Private Sub WriteToClipBoard()
Dim retries As Integer
On Error GoTo Clip_Error
Clipboard.Clear
Clipboard.SetText RemindMe.List1.Text
RemindMe.Text1.SetFocus
Exit Sub
Clip_Error:
If Err = 521 Then
If retries > 10 Then
MsgBox "Unable to access clipboard" & vbCrLf & "Try again later"
Else
retries = retries + 1
Sleep 100
Resume
End If
Else
MsgBox Error$
End If
End Sub
Pete
No trees were harmed in the making of this post, however a large number of electrons were greatly inconvenienced.
-
Nov 21st, 2005, 06:21 PM
#12
Thread Starter
Fanatic Member
Re: Copy to Clipboard error - NOT RESOLVED
Clipboard.GetData is basically the paste function, right?
-
Nov 21st, 2005, 07:43 PM
#13
Thread Starter
Fanatic Member
Re: Copy to Clipboard error - NOT RESOLVED
OKAY - the problem is now resolved... apparently, running the Clipboard.clear and clipboard.settext without a pause in between is causing the problem.... I added a sleep command = 100 and the problem disappeared! thanks to all who helped me track down this solution
-
Nov 21st, 2005, 09:44 PM
#14
Re: Copy to Clipboard error - NOT RESOLVED
 Originally Posted by mateo107
OKAY - the problem is now resolved... apparently, running the Clipboard.clear and clipboard.settext without a pause in between is causing the problem.... I added a sleep command = 100 and the problem disappeared!  thanks to all who helped me track down this solution
weird..never heard that but will sure remember the solution..glad we could help!
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
|