How do I print via macro on a protected worksheet

ghrek

Active Member
Joined
Jul 29, 2005
Messages
426
HI

I have a protected worksheet as I do not want people to put data in certain cells.

What I'm trying to do is set up a print macro but it will not let me print as it states the workbook is protected. Is there anyway I can print a certain area via macro without compromising unprotecting my book and everyone seeing the password.

Any ideas?
 

Excel Facts

Ambidextrous Undo
Undo last command with Ctrl+Z or Alt+Backspace. If you use the Undo icon in the QAT, open the drop-down arrow to undo up to 100 steps.
You will need to include the unprotect into your print code......execute the code then reprotect the worksheet / workbook
 
Upvote 0
@Michael M, that means he will have to hard-code his password and I think that's what he wants to avoid.
Maybe he could also protect his Project to avoid showing the code.
 
Upvote 0
@rollis13
Correct, but as you mentioned, protecting the project will stop anyone from seeing the password....not really any other alternative... :cool: :cool:
 
Upvote 0
VBA menu Tools / Options / Protection, this will 'hide' your macros. Be aware, if you forget this password it wouldn't be easy to retrieve.
 
Upvote 0
Solution

Forum statistics

Threads
1,214,406
Messages
6,119,330
Members
448,888
Latest member
Arle8907

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