Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Disable print from standard toolbar button
Hi Folks,
I have a workbook where I want users to be able to print only from the print controls I have on the worksheets. I have disabled all the print controls using: Private Sub Workbook_Activate() Dim Ctrl As Office.CommandBarControl For Each Ctrl In Application.CommandBars.FindControls(ID:=4) 'print Ctrl.Enabled = False Next Ctrl End Sub However, the print button on the standard toolbar is still active. How do I disable this too? Thanks, Scott |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Disable print from standard toolbar button
This can be done in with one line of code instead of two.
Two lines, may be more informative? '-- Sub GetIDnumber() Dim lngID As Long With Application.CommandBars("Standard") lngID = .Controls(5).ID 'On my machine in xl2003 .FindControl(ID:=lngID).Enabled = False End With End Sub -- Jim Cone Portland, Oregon USA Add-in Review: http://www.contextures.com/excel-sort-addin.html "mooresk257" wrote in message Hi Folks, I have a workbook where I want users to be able to print only from the print controls I have on the worksheets. I have disabled all the print controls using: Private Sub Workbook_Activate() Dim Ctrl As Office.CommandBarControl For Each Ctrl In Application.CommandBars.FindControls(ID:=4) 'print Ctrl.Enabled = False Next Ctrl End Sub However, the print button on the standard toolbar is still active. How do I disable this too? Thanks, Scott |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Select standard toolbar button option | Excel Programming | |||
How do I duplicate a macro for a button on the Standard Toolbar? | Excel Discussion (Misc queries) | |||
How to get Research button on my standard toolbar? | Excel Discussion (Misc queries) | |||
Fax Button on Standard Toolbar | Excel Discussion (Misc queries) | |||
Adding Macro Button on Standard Toolbar | Excel Programming |