Restrict Print Until Some Conditions are made

zeets84

New Member
Joined
Sep 28, 2019
Messages
1
Good Afternoon Mates!

I want to make an excel sheet which will not allow the user to take print until the the latest changes are saved.

Actually I have created a file which requires "password to modify". Without entering the password, one can access the file with "Read Only" mode. But, in read only mode, he can type on a cell but can not save it (since the "Save as" option is made disabled by macros). Here the trouble begins if the Read-Only-User changes any value of a cell, and take the prints. Can anyone help me?

Thanks in advance... :)
Regards,
Zeets
 

Excel Facts

Create a Pivot Table on a Map
If your data has zip codes, postal codes, or city names, select the data and use Insert, 3D Map. (Found to right of chart icons).
In the ThisWorkbook module ( in the VBA editor double-click on ThisWorkbook in the top left window) you can select a Before print event sub
Code:
Private Sub Workbook_BeforePrint(Cancel As Boolean)


End Sub

Here you can make checks to ensure all the data is filled out. If it is not filled out you set Cancel to true, which means it will cancel the user request to print
Code:
Private Sub Workbook_BeforePrint(Cancel As Boolean)
    ' Do the checks to make sure all data is filled out
   ....
   If MyCheck = false then 
      MsgBox "You cannot print until all the required data is filled out"
      cancel = true
   End If
End Sub
 
Upvote 0

Forum statistics

Threads
1,223,885
Messages
6,175,182
Members
452,615
Latest member
bogeys2birdies

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
Back
Top