Function LoadResPicture ?!?

  • Thread starter Thread starter Tom
  • Start date Start date
T

Tom

Hi

I want to create a transparent icon and I found the following article, which
exactly contains the solution for my problem:

HOWTO: Add a Transparent Icon to a Toolbar Button
http://support.microsoft.com/?kbid=260850

The problem is, that the visual basic example contains the function
"LoadResPicture", which is not supported by Excel 2002. How to make this
example work? Any ideas?

Many thanks in advance!

Tom
 
Tom

thank you, but that is definitive too difficult for me. What I need is an
example that works with Excel. My script looks as follows:

Sub Example()
Dim cbrCtrl As CommandBarControl

ThisWorkbook.Worksheets(1).Shapes(1).Copy

Set cbrCtrl = Application.CommandBars("Tools").Controls.Add
With cbrCtrl
.Caption = "Hello World"
.OnAction = ThisWorkbook.Name & "!blabla"
.PasteFace
End With
Application.CutCopyMode = False
End Sub

Now I'd like to make it work with the "transparent"-property. Many thanks in
advance.

Tom
 
If you ronly problem with the original link you posted is the function
LoadResPicture, then change that

Set oICO = LoadResPicture(IconId, vbResIcon)

to

Set ico = LoadPicture("C:\dms\forms\rsignl.ico")

and copy your icon from an icon file. (change the path to point to your
file).
 
Tom

What I need is a working example with an image, that is stored within the
Excel workbook. My example works fine with Excel 97 & 2000. With Excel 2002
the commandbar button looks strange, but with Excel it looks horrible!!!

Sub Example()
Dim cbrCtrl As CommandBarControl

ThisWorkbook.Worksheets(1).Shapes(1).Copy

Set cbrCtrl = Application.CommandBars("Tools").Controls.Add
With cbrCtrl
.Caption = "Hello World"
.OnAction = ThisWorkbook.Name & "!blabla"
.PasteFace
End With
Application.CutCopyMode = False
End Sub


I need a working example for Excel 2002 and Excel 2003. I'm willing to pay
for it!!! If there is anybody out there who can help me please contact me.

Tom
 
Back
Top