Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 224
Default Custom Toolbar Icons Ugly in Excel 2007

I have a custom toolbar icon that looked fine in Excel 2003 but now
looks ugly in Excel 2007. We want it to work in both Excel 2007 and
Excel 2003, so I can't just make a custom Excel 2007 Ribbon tab.

I'm trying it two different ways in Excel 2007, and getting the same
results both ways:

First way:

Dim cbc As Object 'CommandBarControl
Set cbc = cb.Controls.Add(msoControlButton)
cbc.BeginGroup = True
cbc.Caption = "My Icon"
cbc.FaceId = 176
cbc.Style = msoButtonIcon
'Toolbar must be hidden while icon is replaced:
cb.Visible = False
shIcons.Shapes("16x16x256").Copy 'shIcons is a worksheet.
cbc.PasteFace
cb.Visible = True

Second Way:
(Thanks to KeepITCool's posts here)

Dim oMask As stdole.StdPicture
Dim cbc As Object 'CommandBarControl
Set cbc = cb.Controls.Add(msoControlButton)
cbc.BeginGroup = True
cbc.Caption = "My Icon"
cbc.FaceId = 176
cbc.Style = msoButtonIcon
'Toolbar must be hidden while icon is replaced:
cb.Visible = False
shIcons.Shapes("16x16x256_mask").CopyPicture xlScreen, xlBitmap
cbc.PasteFace
Set oMask = CallByName(cbc, "Picture", VbGet)
shIcons.Shapes("16x16x256").CopyPicture xlScreen, xlBitmap
cbc.PasteFace
CallByName cbc, "Mask", VbLet, oMask
cb.Visible = True


The second way looks better in Excel 2003, but both ways look very bad
in Excel 2007.

Any suggestions?


Thanks,

Greg

  #2   Report Post  
Posted to microsoft.public.excel.programming
PJ PJ is offline
external usenet poster
 
Posts: 112
Default Custom Toolbar Icons Ugly in Excel 2007

Sorry Greg, I do not have an answer for your post. I have a similar question
that is why I am adding it to your thread. I am looking for a way to add
customer icons to the toolbar. Do you know of a way?

"Greg Lovern" wrote:

I have a custom toolbar icon that looked fine in Excel 2003 but now
looks ugly in Excel 2007. We want it to work in both Excel 2007 and
Excel 2003, so I can't just make a custom Excel 2007 Ribbon tab.

I'm trying it two different ways in Excel 2007, and getting the same
results both ways:

First way:

Dim cbc As Object 'CommandBarControl
Set cbc = cb.Controls.Add(msoControlButton)
cbc.BeginGroup = True
cbc.Caption = "My Icon"
cbc.FaceId = 176
cbc.Style = msoButtonIcon
'Toolbar must be hidden while icon is replaced:
cb.Visible = False
shIcons.Shapes("16x16x256").Copy 'shIcons is a worksheet.
cbc.PasteFace
cb.Visible = True

Second Way:
(Thanks to KeepITCool's posts here)

Dim oMask As stdole.StdPicture
Dim cbc As Object 'CommandBarControl
Set cbc = cb.Controls.Add(msoControlButton)
cbc.BeginGroup = True
cbc.Caption = "My Icon"
cbc.FaceId = 176
cbc.Style = msoButtonIcon
'Toolbar must be hidden while icon is replaced:
cb.Visible = False
shIcons.Shapes("16x16x256_mask").CopyPicture xlScreen, xlBitmap
cbc.PasteFace
Set oMask = CallByName(cbc, "Picture", VbGet)
shIcons.Shapes("16x16x256").CopyPicture xlScreen, xlBitmap
cbc.PasteFace
CallByName cbc, "Mask", VbLet, oMask
cb.Visible = True


The second way looks better in Excel 2003, but both ways look very bad
in Excel 2007.

Any suggestions?


Thanks,

Greg


  #3   Report Post  
Posted to microsoft.public.excel.programming
PJ PJ is offline
external usenet poster
 
Posts: 112
Default Custom Toolbar Icons Ugly in Excel 2007

CUSTOM icons, not customer icons. oops.

"PJ" wrote:

Sorry Greg, I do not have an answer for your post. I have a similar question
that is why I am adding it to your thread. I am looking for a way to add
customer icons to the toolbar. Do you know of a way?

"Greg Lovern" wrote:

I have a custom toolbar icon that looked fine in Excel 2003 but now
looks ugly in Excel 2007. We want it to work in both Excel 2007 and
Excel 2003, so I can't just make a custom Excel 2007 Ribbon tab.

I'm trying it two different ways in Excel 2007, and getting the same
results both ways:

First way:

Dim cbc As Object 'CommandBarControl
Set cbc = cb.Controls.Add(msoControlButton)
cbc.BeginGroup = True
cbc.Caption = "My Icon"
cbc.FaceId = 176
cbc.Style = msoButtonIcon
'Toolbar must be hidden while icon is replaced:
cb.Visible = False
shIcons.Shapes("16x16x256").Copy 'shIcons is a worksheet.
cbc.PasteFace
cb.Visible = True

Second Way:
(Thanks to KeepITCool's posts here)

Dim oMask As stdole.StdPicture
Dim cbc As Object 'CommandBarControl
Set cbc = cb.Controls.Add(msoControlButton)
cbc.BeginGroup = True
cbc.Caption = "My Icon"
cbc.FaceId = 176
cbc.Style = msoButtonIcon
'Toolbar must be hidden while icon is replaced:
cb.Visible = False
shIcons.Shapes("16x16x256_mask").CopyPicture xlScreen, xlBitmap
cbc.PasteFace
Set oMask = CallByName(cbc, "Picture", VbGet)
shIcons.Shapes("16x16x256").CopyPicture xlScreen, xlBitmap
cbc.PasteFace
CallByName cbc, "Mask", VbLet, oMask
cb.Visible = True


The second way looks better in Excel 2003, but both ways look very bad
in Excel 2007.

Any suggestions?


Thanks,

Greg


  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 224
Default Custom Toolbar Icons Ugly in Excel 2007

My original post, to which you replied, shows two ways. Both work for
me. In Excel 2003, the longer way results in a slightly better-looking
icon.

Greg

On Sep 7, 1:22 pm, PJ wrote:
Sorry Greg, I do not have an answer for your post. I have a similar question
that is why I am adding it to your thread. I am looking for a way to add
customer icons to the toolbar. Do you know of a way?

"Greg Lovern" wrote:
I have a custom toolbar icon that looked fine in Excel 2003 but now
looks ugly in Excel 2007. We want it to work in both Excel 2007 and
Excel 2003, so I can't just make a custom Excel 2007 Ribbon tab.


I'm trying it two different ways in Excel 2007, and getting the same
results both ways:


First way:


Dim cbc As Object 'CommandBarControl
Set cbc = cb.Controls.Add(msoControlButton)
cbc.BeginGroup = True
cbc.Caption = "My Icon"
cbc.FaceId = 176
cbc.Style = msoButtonIcon
'Toolbar must be hidden while icon is replaced:
cb.Visible = False
shIcons.Shapes("16x16x256").Copy 'shIcons is a worksheet.
cbc.PasteFace
cb.Visible = True


Second Way:
(Thanks to KeepITCool's posts here)


Dim oMask As stdole.StdPicture
Dim cbc As Object 'CommandBarControl
Set cbc = cb.Controls.Add(msoControlButton)
cbc.BeginGroup = True
cbc.Caption = "My Icon"
cbc.FaceId = 176
cbc.Style = msoButtonIcon
'Toolbar must be hidden while icon is replaced:
cb.Visible = False
shIcons.Shapes("16x16x256_mask").CopyPicture xlScreen, xlBitmap
cbc.PasteFace
Set oMask = CallByName(cbc, "Picture", VbGet)
shIcons.Shapes("16x16x256").CopyPicture xlScreen, xlBitmap
cbc.PasteFace
CallByName cbc, "Mask", VbLet, oMask
cb.Visible = True


The second way looks better in Excel 2003, but both ways look very bad
in Excel 2007.


Any suggestions?


Thanks,


Greg


Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Customising icons in Quick Access Toolbar Excel 2007 LJDL Excel Discussion (Misc queries) 1 December 12th 07 11:13 PM
What causes custom icons in the excel standard toolbar Donald1929 Excel Discussion (Misc queries) 2 December 1st 07 07:11 AM
Custom Toolbar Icons PJ Excel Discussion (Misc queries) 4 September 10th 07 03:52 PM
Excel 2007 Toolbar Icons JonathanS Setting up and Configuration of Excel 2 June 11th 07 08:55 AM
Grouping of icons in the Quick Access Toolbar... Excel 2007 R. Hamel Excel Discussion (Misc queries) 0 June 3rd 06 06:04 PM


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

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"