Encrypt Macro

festivalsimmo

New Member
Joined
Jul 26, 2011
Messages
2
Hi all,

I'm only recently learning about macros, so this may be an easy question to answer, but hopefully someone here can help.

I'm trying to build a macro into a workbook whereby when someone opens the workbook it's unencrypted, but when they click a "Submit" button, it automatically encrypts with a password I've generated.

So far I've created the macro and encrypted the workbook, but when I save it, it's encrypted the next time I open it, which isn't helpful. And when I unencrypt it myself, the macro loses the password.

I've just been using the "record macro" buttons, as I don't know anything really about scripting.

Any help would be much appreciated.
 

Excel Facts

How to total the visible cells?
From the first blank cell below a filtered data set, press Alt+=. Instead of SUM, you will get SUBTOTAL(9,)
Just a quick bump cause this moved down to page 18 and an update.

I've also tried running a macro that automatically protects the worksheet and sends it...again, the trouble is that the password I set to protect the document vanishes in the macro. It protects the sheet, but without a password.
 
Upvote 0

Forum statistics

Threads
1,224,568
Messages
6,179,572
Members
452,927
Latest member
whitfieldcraig

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