Security for Excel document

aurelius89

Board Regular
Joined
Mar 15, 2017
Messages
69
I need to make my document as secure as possible (With VBA as well)

I will be distributing it out to users, but nothing is stopping them from taking it and walking out the door and giving to someone else.

Although I know Excel isn't the most secure and isn't meant to, but I want to make it as difficult as possible for them.

My ideas are
- Password protect VB editor
- Password protect each sheet
- Disable save, save as, save and send or any other way that a copy of the file could be made from within Excel
- The document itself as an RDP from a server which can be controlled then by Active Directory

So my question is 2 part really, what else can I do?

and what VBA would be needed to completely disable the features I have mentioned?

Thanks
 
Last edited:

Excel Facts

Round to nearest half hour?
Use =MROUND(A2,"0:30") to round to nearest half hour. Use =CEILING(A2,"0:30") to round to next half hour.
Hia
You can also protect the workbook, which should prevent someone from copying a sheet to a new workbook.
To prevent saving try this
Code:
Sub Workbook_BeforeClose(Cancel As Boolean)
     
     ActiveWorkbook.Close savechanges:=False
     
End Sub

Private Sub Workbook_BeforeSave(ByVal SaveAsUI As Boolean, Cancel As Boolean)

    MsgBox "Sorry - But this Workbook cannot be saved"
    Cancel = True

End Sub
BUT this will prevent anyone from saving
 
Upvote 0
Hia
You can also protect the workbook, which should prevent someone from copying a sheet to a new workbook.
To prevent saving try this
Code:
Sub Workbook_BeforeClose(Cancel As Boolean)
     
     ActiveWorkbook.Close savechanges:=False
     
End Sub

Private Sub Workbook_BeforeSave(ByVal SaveAsUI As Boolean, Cancel As Boolean)

    MsgBox "Sorry - But this Workbook cannot be saved"
    Cancel = True

End Sub
BUT this will prevent anyone from saving

Thanks I have got these working fine.

I have also followed the guidance at the bottom of this thread to create custom UI to stop the save and send:

Disable 'Send' in Excel 2007
 
Upvote 0
you need to disable macros, then open the workbook, add the macros, save the workbook & then re-enable macros
 
Upvote 0

Forum statistics

Threads
1,223,896
Messages
6,175,262
Members
452,627
Latest member
KitkatToby

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