LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 176
Default Removing Picture from Cell Command Bar

Rick,

After you've added the control to the Cell commandbar, you can change it by addressing it this way:

With Application.CommandBars("Cell").Controls("Alpha Sort Asc")
Sheet1.Shapes(btnOtherTick).CopyPicture
.PasteFace
.Enabled = True
End With

Where, obviously, btnOtherTick is a variable containing the name of a valid shape object on Sheet1.
HTH,
Bernie
Excel MVP


"Rick De Marco" wrote in message om...
Hi,

I have a small problem and I was wondering if anyone could help. I am
using the following code to add new buttons to the right click menu

With Application.CommandBars("Cell").Controls.Add(msoCo ntrolButton,
temporary:=True)
Sheet1.Shapes(btnTick).CopyPicture
.PasteFace
.Enabled = False
.Caption = "Alpha Sort Asc"
End With

This all works fine and I get a new menu item with the associated
picture. The affect I am trying to make is - when a user right clicks
on a cell and select one on my menu items I want to put a tick next to
it, which I can do fine. My problem is that when a user selects a
different menu item i then need to remove the picture from the
previously selected item and move it to the newly selected. Can anyone
tell me how I can remove the picture without deleting the menu item
and adding it again? Basically I am trying to hide the picture if the
menu item is not selected and make it visible if it is selected.

Thanks,

Rick



 
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
Removing a picture box from an Excel 2007 spreadsheet SMG Excel Worksheet Functions 6 February 13th 09 08:46 AM
Removing a picture box in Excell 2007 SMG Excel Discussion (Misc queries) 0 February 13th 09 12:40 AM
Inserting a Picture using Cell as picture name. the-jackal Links and Linking in Excel 12 November 10th 08 09:21 AM
how do I insert picture into cell so vlookup can return picture? ah Excel Worksheet Functions 1 May 1st 07 04:38 AM
Removing "Save As" Command from an excel file. Camper Joe Excel Worksheet Functions 0 December 19th 05 03:00 PM


All times are GMT +1. The time now is 04:04 PM.

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"