Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 50
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,549
Default 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
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
Select standard toolbar button option Gary''s Student Excel Programming 7 March 15th 07 03:24 AM
How do I duplicate a macro for a button on the Standard Toolbar? Suzi Excel Discussion (Misc queries) 1 February 13th 07 11:38 PM
How to get Research button on my standard toolbar? justpeeking89 Excel Discussion (Misc queries) 0 March 26th 06 11:50 PM
Fax Button on Standard Toolbar Bruce Excel Discussion (Misc queries) 1 April 19th 05 10:35 PM
Adding Macro Button on Standard Toolbar sebastienm Excel Programming 3 August 19th 04 03:59 AM


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

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"