ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   compile error with FaceId (https://www.excelbanter.com/excel-programming/406163-compile-error-faceid.html)

R Vaughn

compile error with FaceId
 
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, _
Befo=11, _
Temporary:=True)
MenuObject.Caption = "Projects"
MenuObject.FaceId = 17
End Sub


Chip Pearson

compile error with FaceId
 
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)

"R Vaughn" wrote in message
...
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, _
Befo=11, _
Temporary:=True)
MenuObject.Caption = "Projects"
MenuObject.FaceId = 17
End Sub



Dave Peterson

compile error with FaceId
 
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, _
Befo=11, _
Temporary:=True)
MenuObject.Caption = "Projects"
MenuObject.FaceId = 17
MenuObject.Style = msoButtonIconAndCaption
End Sub

R Vaughn wrote:

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, _
Befo=11, _
Temporary:=True)
MenuObject.Caption = "Projects"
MenuObject.FaceId = 17
End Sub


--

Dave Peterson


All times are GMT +1. The time now is 03:42 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com