LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #9   Report Post  
Posted to microsoft.public.excel.programming
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.







 
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
Command Button Excel 2007 dhstein Excel Discussion (Misc queries) 4 February 15th 09 04:14 PM
Command Button to store a value in Excel/VBA....... chadtastic[_3_] Excel Discussion (Misc queries) 1 September 3rd 07 06:36 PM
Excel Add-In with Command Button Controls Mark Dev Excel Programming 3 May 21st 05 02:14 PM
Can I run a macro from a command button in Excel? jacchops Excel Programming 3 February 16th 05 06:18 PM
excel, vba, command button jimx[_2_] Excel Programming 2 June 1st 04 05:38 PM


All times are GMT +1. The time now is 01:15 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"