korhan
Board Regular
- Joined
- Nov 6, 2009
- Messages
- 215
Hello everyone,
I am having a little really nasty issue with VBA where I cannot find any solution at all. I am getting this infamous warning message where it displays
"We couldn't free up space on the clipboard. Another program might be using it right now". VBA gets into debugging mode and when I hit debug and then F5, it continues for a while and then the same message pops up. So annoying.
I am pretty sure this is caused by copying and pasting a range as a picture.
I am using the method below to copy a range as a picture:
Is there anyway to overcome this problem?
Note: Please, don't give me Application.CutCopyMode = False. It doesn't work
doesn't work.
doesn't work.
This is a ridiculous error. There should be a solution.
I am having a little really nasty issue with VBA where I cannot find any solution at all. I am getting this infamous warning message where it displays
"We couldn't free up space on the clipboard. Another program might be using it right now". VBA gets into debugging mode and when I hit debug and then F5, it continues for a while and then the same message pops up. So annoying.
I am pretty sure this is caused by copying and pasting a range as a picture.
I am using the method below to copy a range as a picture:
Code:
rngHours.CopyPicture xlScreen, xlPicture
Set picHours = wsTemp.Pictures.
picHours.Left = .Range("D" & .Cells(Rows.Count, Range("D1").Column).End(xlUp).Row + 2).Left
picHours.Top = .Range("D" & .Cells(Rows.Count, Range("D1").Column).End(xlUp).Row + 2).Top
Is there anyway to overcome this problem?
Note: Please, don't give me Application.CutCopyMode = False. It doesn't work
Code:
Sub CopyToClipboard()
Dim clipboard As MSForms.DataObject
Set clipboard = New MSForms.DataObject
clipboard.SetText ActiveSheet.Range("B2")
clipboard.PutInClipboard
End Sub
Code:
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
This is a ridiculous error. There should be a solution.