Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Robin,
Thanks for the additional comments. Not sure if I'm pleased to know of this potential problem, or to have carried on in blissful ignorance of something that (hopefully) will not arise <g. Regards, Sandy Robin Hammond wrote: I've seen it on various machines, built, rebuilt, reinstalled, other users, repeatedly. It can also happen when you are copying and pasting charts or sheets as pictures, particularly from Excel into Word. It might run fine a thousand times, but the next one after that gets you. Strangely enough, you can usually step through the code after that in the vbe. Whatever clipboard is being used (it's not the Excel one or the standard windows one because I've checked at length), it appears not to clear properly with no apparent cause. Robin Hammond www.enhanceddatasystems.com "Sandy V" wrote in message ... Robin, However, I have learned from experience that in Excel 97 the PasteFace method is very unreliable, and that it is not foolproof in Excel 2000 either. I've been using PasteFace to copy an image to an icon (msoControlButton) in Excel 97 for a long time. Never had a problem, nor received feedback from users of a problem. A very old Visio installer uses similar. Not questioning what you say, rather I would like to get to the bottom of it. I want to feel relaxed about continuing to use it. Anyone else had a problem with PasteFace in Excel 97 ? Regards, Sandy Robin Hammond wrote: Frank, A word of warning. I use a similar method to create toolbars on the fly. However, I have learned from experience that in Excel 97 the PasteFace method is very unreliable, and that it is not foolproof in Excel 2000 either. It causes an error along the lines of "method pasteface of picture object failed" in some instances. As far as I can tell it has something to do with the use of a non-excel and non-Windows clipboard and there is no way to clear the clipboard on an error, even with API calls. I set the whole thing up with an application version qualifier and now only allow text entries on the toolbar for versions below XP by setting the style to msoButtonCaption and skipping the pasteface method. Abridged example. If Val(Application.Version) 9 Then ctlInsert.Style = msoButtonIcon ThisWorkbook.Shapes("PIC" & RowNum).Copy ctlInsert.PasteFace Else ctlInsert.Style = msoButtonCaption End If Robin Hammond www.enhanceddatasystems.com |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Group drawing objects in VBA | Excel Discussion (Misc queries) | |||
Cutting Drawing Objects | Excel Discussion (Misc queries) | |||
HOW DO I KEEP DRAWING OBJECTS ANCHORED? | Excel Discussion (Misc queries) | |||
Storing generic objects in workbook via automation | Excel Programming | |||
[Q] parameters to drawing objects | Excel Programming |