Disable only the Print Button. NOT File -> Print,or Print Preview

longstick

New Member
Joined
Nov 19, 2011
Messages
42
I've tried search the web looking for an answer and hoping I wouldn't have to post here. Its too easy to just post a question and have someone fix it for me.

I have a sheet that copies information to a secondary location when printed. This sheet is opened in read-only and the user won't save the workbook. The user does not see the secondary workbook. It opens, saves, and closes without the user's knowledge.

I need to disable the print button on the tool bar because they are required to print 2 or more copies of this sheet. If they hit the print button more than once than the information is copied more than once.

I would like the user to use File -> Print and then select multiple copies to be printed. Is there a way to limit the user to using File -> Print without putting a Print User Button on the actual worksheet?
Thanks
 

Excel Facts

Excel Wisdom
Using a mouse in Excel is the work equivalent of wearing a lanyard when you first get to college

drsarao

Well-known Member
Joined
Sep 9, 2009
Messages
1,143
Office Version
  1. 2007
Platform
  1. Windows
One way to do it is by customizing the toolbar.
You can delete the "Print" button and insert "Print..." button.
You will find it in by Right click Menu bar --> Customise--> Commands ---> File... Search in the right hand pane.

This button works exactly like File-->Print, producing the dialog box for settings etc.
 

longstick

New Member
Joined
Nov 19, 2011
Messages
42
A Friend gave me this. The only issue would be if another user has their tool bar setup differently (from what I understand).

I was told it deactivates the print button when the required workbook is selected. It activates the print button when a different or other workbook is selected.

Code:
Private Sub Workbook_Activate()                                   
    Application.CommandBars.FindControl(ID:=2521).Enabled = False
End Sub


Private Sub Workbook_BeforeClose(Cancel As Boolean)
    Application.CommandBars.FindControl(ID:=2521).Enabled = True
End Sub


Private Sub Workbook_Deactivate()
    Application.CommandBars.FindControl(ID:=2521).Enabled = True
End Sub


Private Sub Workbook_Open()
    Application.CommandBars.FindControl(ID:=2521).Enabled = False
End Sub
 
Last edited:

Forum statistics

Threads
1,136,855
Messages
5,678,143
Members
419,746
Latest member
tysonboy82

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Top