View Single Post
  #15   Report Post  
Posted to microsoft.public.excel.programming
Steve Steve is offline
external usenet poster
 
Posts: 97
Default Command Button in Excel

Oops
Read the question right but answered for a button added to a sheet.

Try:
Application.CommandBars(" APW Convert ").Delete ' should work.

The following will remove all non-standard bars:

For Each bar In Application.CommandBars
If Not bar.BuiltIn Then bar.Delete
Next

"Steve" <No Spam wrote in message ...
Turn on your Control Toolbox menubar.
Click on the icon that looks like a set-square and pencil.
Click on your button and press delete.



"Curt" wrote in message
...
I pulled abutton into a sheet noe I am unable to find a way to delete it.
going into formula bar doesn't do it. I can get no results with cusor on
the
button. Was able to cut and paste it to another location this did not
remove
the origional. Any Ideas HELP

"STEVE BELL" wrote:

Frederic,

Here is some general code to add/delete command bars.
(be sure to fix word wrap)

Use the workbook open (or workbook activate) event to creat the bar
Use the workbook close (or workbook deactivate) event to delete the bar

Sub CommandBarCreate()
'NewToolBar()
Dim cbrCommandBar As CommandBar
Dim cbcCommandBarButton As CommandBarButton

' If the command bar exits, remove it.
On Error Resume Next
Application.CommandBars(" APW Convert ").Delete

' Add the command bar to the application's
' CommandBars collection.
Set cbrCommandBar = _
Application.CommandBars.Add
cbrCommandBar.Name = " APW Convert "

' Add command button control to the control's
' collection of CommandBar objects.
With cbrCommandBar.Controls
Set cbcCommandBarButton = _
.Add(msoControlButton)

' Set properties of the command button.
With cbcCommandBarButton
.Style = msoButtonIconAndCaption
.Caption = " APW Convert "
.FaceId = 1
.TooltipText = _
"Press me to convert APW."
.OnAction = "apwConvert"
.Tag = "apwconvert"
End With

End With
cbrCommandBar.Visible = True
cbrCommandBar.Left = 125
cbrCommandBar.Top = 150

End Sub

Sub CommandBarDelete()
Application.CommandBars(" APW Convert ").Delete
End Sub


--
steveB

Remove "AYN" from email to respond
"Frederic" wrote in message
...
I have a command button on the toolbar of my excel spreadsheet. However
I
need to send this spreadsheet out to other people and once sent to
them,
the
command button doesn't appear on their toolbar. Is there a way of
making
it
happen, or even better is there a way of having the command button in
the
spreadsheet (I mean in one cell)?
Any advise, help would be greatly appreciated.