View Single Post
  #4   Report Post  
Posted to microsoft.public.excel.programming
mikegospo[_4_] mikegospo[_4_] is offline
external usenet poster
 
Posts: 1
Default add a print key only


Didnt work Tom, this is what I put in.

Private Sub Workbook_Activate()
Dim bar As CommandBar
For Each bar In Application.CommandBars
bar.Enabled = False
Next
On Error Resume Next
CommandBars("PrintBar").Delete
On Error GoTo 0
Application.CommandBars.Add(Name:="PrintBar").Visi ble = True
Application.CommandBars("PrintBar").Controls.Add _
Type:=msoControlButton, ID:=4, Befo=1
End Sub

Private Sub Workbook_Deactivate()
Dim bar As CommandBar
For Each bar In Application.CommandBars
bar.Enabled = True
Next
On Error Resume Next
CommandBars("PrintBar").Delete
On Error GoTo 0
End Sub

It hangs on the last CommandBars command
CommandBars("PrintBar").Delete


------------------------------------------------
~~ Message posted from http://www.ExcelTip.com/
~~View and post usenet messages directly from http://www.ExcelForum.com/

~~Now Available: Financial Statements.xls, a step by step guide to creating financial statements