Thread: Face ID
View Single Post
  #3   Report Post  
Posted to microsoft.public.excel.misc
gc gc is offline
external usenet poster
 
Posts: 13
Default Face ID

you cannot add an image to Excel's built-in images accessible via the
FaceID property.

Mn... not even if one is willing to write some code in C++ to register new
FaceIDs?

I'm asking because my Excel application creates its own toolbar and attaches
the icons to buttons using the "CommandBarButton::PasteFace()" method, but
this is not reliable.
There is another commercial application used by our users, that does
something to the Office Clipboard in the background and causes PasteFace() to
fail. To figure out what is the root of the problem I wrote a simple
subroutine that continuously copies and paste the contents of a cell
(therefore forcing objects to be added and deleted from the clipboard). When
this is running, "pasteFace" fails. It seems to me that the cause is that the
clipboard is shared by all office apps. If, between the time the icon is
copied to the clipboard and it is pasted using PasteFace, another application
upts more than 24 objects, then the icon that should be added doesn't exist
anymore and pasteface fails.

Defining new FaceId seems to me the only likely solution to this problem...
or are there other work-arounds (that don't use pasteface)?

Thanks
P.S. the code I use to fill-in the clipboard follows. I add it to a session
of excel and run it. When I open a new Excel session and open my application
that build the toolbar, none of the icons are pasted.

Option Explicit

Private Sub CommandButton1_Click()
Dim i As Long
Dim j As Long
Dim numRows As Long

numRows = 40
Do While True
j = j + 1
For i = 1 To numRows
Range("a1:a40")(i, 1).Select
Selection.Copy
Range("b1:b40")((i + j) Mod numRows + 1, 1).Select
ActiveSheet.Paste
Next i
Loop
End Sub



You can edit a toolbutton image and you can paste a new image onto a tool
button, but you cannot add an image to Excel's built-in images accessible
via the FaceID property. The later always refers to one of the built-in
images.

--
Jim
"Beagle" wrote in message
...
| Hello,
|
| Is there a way to create a new FACE ID picture than the ones that are
| already listed?
|
|