?
Solved

Create customised control Face Id's and attach them to Excel control controls

Posted on 2003-12-01
9
Medium Priority
?
524 Views
Last Modified: 2010-05-01
Hi All,

I've written some simple code below to add some toolbar controls to a custom commandbar. I want to put custom built face iIs on the buttons and it sounds like this can be done by pasting the Face Id's from the Clipboard. But this is outside my Excel programming skill, how do I create, then acess custom button faceid's via the Clipboard?

Cheers

Dave

Public Const CB As String = "Colour Toolbar"

Sub NewToolbar()
Dim Ctrl       As CommandBarControl
Dim TB         As CommandBar
    On Error Resume Next
    Application.CommandBars(CB).Delete
    On Error GoTo 0
    Set TB = Application.CommandBars.Add(Name:=CB, Position:=msoBarTop)
    TB.Visible = True
        For i = 1 To 3
        Set Ctrl = TB.Controls.Add(Type:=msoControlButton)
        Ctrl.FaceId = 400 + i  'Random id's
        Ctrl.Caption = "Control " & i
    Next
End Sub
0
Comment
Question by:Dave Brett
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 4
  • 3
  • 2
9 Comments
 
LVL 5

Expert Comment

by:rajaamirapu
ID: 9855680
Clipboard.SetData LoadPicture(App.Path & "\Help.bmp")
    Set cbSubCommandBar = cbMenuCommandBar.Controls.Add(1)
    cbSubCommandBar.Caption = "Help"
    cbSubCommandBar.PasteFace
Hope this helps
See the link
0
 
LVL 50

Author Comment

by:Dave Brett
ID: 9855871
no link?
0
 
LVL 5

Assisted Solution

by:rajaamirapu
rajaamirapu earned 400 total points
ID: 9855921
I missed the Link Using PasteFace you can do this
Ctrl.FaceId = 400 + i  'Random id's
Ctrl.Caption = "Control " & i
Clipboard.SetData LoadPicture(App.Path & "\Help.bmp")
cbSubCommandBar.PasteFace

0
What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

 
LVL 50

Author Comment

by:Dave Brett
ID: 9862500
Hi,

I cant seem to load the ClipBoard from Excel

Cheers

Dave
0
 
LVL 17

Expert Comment

by:Suat Ozgur
ID: 9862771
Yes, Dave. VBA doesn't have Clipboard object but VB.

Have you seen the second method ?

http://www.mvps.org/word/FAQs/MacrosVBA/SetCustomButtonImage.htm

Suat
0
 
LVL 17

Accepted Solution

by:
Suat Ozgur earned 1600 total points
ID: 9862793
0
 
LVL 50

Author Comment

by:Dave Brett
ID: 9862836
I cant believe I missed that link  - thanks Suat

Thanks to you as well rajaamirapu , I've given you some points for your effort

Cheers

Dave
0
 
LVL 17

Expert Comment

by:Suat Ozgur
ID: 9862963
Great to hear it helps!!!

I think I have free access on VIP next month too!! If it is still 3000 points... LOL!! ;)

Suat
(Thanks for the grade, Dave)
(By the way, am I the only one who gets notification emails from EE very but VERY late. It was manual refresh this time to make sure.  I have been getting notifications TOMORROW!)
0
 
LVL 50

Author Comment

by:Dave Brett
ID: 9863129
Me too - the EE mail is arriving up to a day late
0

Featured Post

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This article describes some techniques which will make your VBA or Visual Basic Classic code easier to understand and maintain, whether by you, your replacement, or another Experts-Exchange expert.
You can of course define an array to hold data that is of a particular type like an array of Strings to hold customer names or an array of Doubles to hold customer sales, but what do you do if you want to coordinate that data? This article describes…
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
Get people started with the process of using Access VBA to control Outlook using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Microsoft Outlook. Using automation, an Access applic…
Suggested Courses
Course of the Month11 days, 15 hours left to enroll

752 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question