compile error with FaceId

R

R Vaughn

I am unable to run the following subroutine because of a compile error that
flags the FaceId text in the last line of code ( "method or data member not
found") Why?

Sub DummyMacro()
Dim MenuObject As CommandBarPopup
Set MenuObject = Application.CommandBars(1). _
Controls.Add(Type:=msoControlPopup, _
Before:=11, _
Temporary:=True)
MenuObject.Caption = "Projects"
MenuObject.FaceId = 17
End Sub
 
C

Chip Pearson

A msoControlPopup can't have a FaceID.


--
Cordially,
Chip Pearson
Microsoft Most Valuable Professional
Excel Product Group, 1998 - 2008
Pearson Software Consulting, LLC
www.cpearson.com
(email on web site)
 
D

Dave Peterson

I don't think you can have a .faceid for a commandbarpopup. Maybe you want a
commandBarButton instead????

Option Explicit
Sub DummyMacro()
Dim MenuObject As CommandBarButton
Set MenuObject = Application.CommandBars(1). _
Controls.Add(Type:=msoControlButton, _
Before:=11, _
Temporary:=True)
MenuObject.Caption = "Projects"
MenuObject.FaceId = 17
MenuObject.Style = msoButtonIconAndCaption
End Sub
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top