karldenton Posted August 1, 2011 Posted August 1, 2011 Hi I have an Excel worksheet that I want to disable printing on. I have tired the following macro but still prints Private Sub Workbook_BeforePrint(Cancel As Boolean) Cancel = True End Sub
Steve21 Posted August 1, 2011 Posted August 1, 2011 Where did you add the macro? If it's not added to the workbook module it wouldn't actually get called by default. (And obviously if the excel file is opened without macro's it won't work either) Steve
karldenton Posted August 1, 2011 Author Posted August 1, 2011 It down as module6 in Excel. Does it need to be Private Sub or just Sub.
karldenton Posted August 1, 2011 Author Posted August 1, 2011 Sorted it. As said above, put it into the worksheet rather than a module and is spot on
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now