Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 12
Default Clipboard macro seriously locks up (or whatever it does) myclipboard! [XL2003]

Hello, everyone!

I've found that a workbook of mine seriously wrecks the clipboard.
When I use the script once, everything seems fine. But if I run it
again or at least more than once, my clipboard is shot and nothing
restores it. I set up a script in a third party scripting language
after much research on the web yesterday and even shutting down
rdpclip.exe doesn'f fix things, The same script then launches the
clipboard viewer, clipbrd.exe, but the interesting thing that showed
is that the viewer flickers wildly and never opens properly. It's as
if the clipboard is wide open, maybe, and constantly looping, I don't
know. But ever after, I get all sorts of error commands like "can't
open clipboard" or "out of memory" and anything save to the clipboard
doesn't come out. The copy commands aren't greyed out anywhere, it's
just that nothing is retrieved from the clipboard.

I'm guessing that something needed closing somewhere so tried that
code from a source online for problems of this type but nothing short
of a reboot fixes this. In fact, this morning, even that didn't and I
had to shut down completely and let the box sit for a bit before
clipboard function was restored. One doesn't realize how much one
relies on the clipboard until it's not there, let me tell you!

Here is where the offending code lies:
******************
Sub Msg_CopyQuotefallToImage()
'
If Selection.Cells.Count = 1 Then
MsgBox ("You have only one cell selected; " & vbCrLf &
_
"pls increase the selection area" & vbCrLf & _
"before trying again.")

Exit Sub
End If

Application.CutCopyMode = False
Selection.CopyPicture Appearance:=xlScreen, Format:=xlPicture
' Selection.CopyPicture Appearance:=xlScreen, Format:=xlBitmap
MyMsgBox = MsgBox("The cells have been sent to the clipboard as an
image." & vbCrLf & vbCrLf & _
"PASTE DIRECTLY INTO WORD for best results!" &
vbCrLf & vbCrLf & _
"(Stretch width for resulting Word graphic to
about 7 inches, max.) ", vbOKOnly 2+ vbInformation, "DONE ...")
End Sub
******************

I added in the "Application.CutCopyMode = False" as advised in the fix
but that didn't seem to help. I need to be able to press the copy
image button without fear any number of retries when I change the
source data.

Also, don't know if the copypicture command itself might be at fault.
I can't figure out if there's any difference between the "xlPicture"
format or the "xlBitmap" one and right now am afraid to try again
because when I use this script, I run into trouble <g.

Anyone know how to get this to work without freaking out the clipboard
in Windows, by any chance? <g

Thanks. :)
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 12
Default Clipboard macro seriously locks up (or whatever it does) myclipboard! [XL2003]

The part of the code above that is what gives trouble is either of
these two:

Selection.CopyPicture Appearance:=xlScreen, Format:=xlPicture
Selection.CopyPicture Appearance:=xlScreen, Format:=xlBitmap

If I run the macro once, no problem, but if I adjust the area and
press again, it seems to lock up the clipboard or somehow make it stop
working.

Is there code to put before this that empties the clipboard? What I
put didn't work (Application.CutCopyMode = False, found on the net).
Even with that line there the problem still occurs. Nothing short of
a reboot and sometimes complete shutdown, restores the clipboard
functionality.

Thanks.
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
Transfer clipboard from Task pane clipboard(office?) content to Excel (windows?) clipboard? tskogstrom Excel Programming 2 March 6th 07 12:50 PM
Programmatically pasting a Function locks macro diglas1 via OfficeKB.com Excel Programming 1 June 16th 06 11:37 PM
Worksheet_Change macro locks up Excel JG Scott Excel Programming 3 November 18th 05 08:06 PM
calc locks up after running a macro that moves sheets to a new fil shibao Excel Discussion (Misc queries) 0 November 7th 05 10:58 PM
Macro locks me in a single XLS file Luca T. Excel Programming 5 September 13th 04 01:58 AM


All times are GMT +1. The time now is 07:27 AM.

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

About Us

"It's about Microsoft Excel"