Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 273
  • Last Modified:

How to protect excel files with vb wrap or vb class?

How to write a ocx or dll which will protect excel files from

- updating content (worksheet or certain area)
- resizing worksheet/cell
- view vb code or macros
- updating formula

I am looking vb dll/ocx code which will do all this above like as wrap around excel files.
Please give me code.
0
sanjuo
Asked:
sanjuo
  • 3
  • 2
  • 2
  • +3
3 Solutions
 
Richie_SimonettiIT OperationsCommented:
Mostly of them could be done protecting the worksheet.
For Code, you could use a password for the project.
0
 
WintersVineCommented:
cell protection is a cell property. i.e. you can set what cells (or other items) you want to be locked.
Then you need to select: Tools>>Protection>>Protect_Worksheet

from you code editor select:
Tools>>VBAProject_Propeties . . .
then select the "Protection" Tab
Click the "Lock Project for Viewing" Tab
and enter a password - its case-sensitive

if you close and re-open the workbook and try to look at the code you will be prompted for a password. DON'T FORGET YOUR PASSWORD. your code will be lost if you do . . .

just expounding on Richie's correct answer . . .
-David
0
 
WintersVineCommented:
cell protection is a cell property. i.e. you can set what cells (or other items) you want to be locked.
Then you need to select: Tools>>Protection>>Protect_Worksheet

from you code editor select:
Tools>>VBAProject_Propeties . . .
then select the "Protection" Tab
Click the "Lock Project for Viewing" Tab
and enter a password - its case-sensitive

if you close and re-open the workbook and try to look at the code you will be prompted for a password. DON'T FORGET YOUR PASSWORD. your code will be lost if you do . . .

just expounding on Richie's correct answer . . .
-David
0
Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
SteinerCommented:
Just one thought about security:
The built-in protection for the worksheet and the VBA-Code aren't that secure. They should be enough to keep nosy users away, but if someone really wants to break it, it's not a big challenge, as there are many tools out there that break these protections.

For your VBA code: you could try to export the code to a dll itself. Since that .dll is compiled, a user will have a harder time to view it.
0
 
Richie_SimonettiIT OperationsCommented:
Steiner is correct, at least for VBA code. For the worksheet protection, it is harder but not impossible.
Anyway, i only know brute-force approach to crack a protected worksheet.
0
 
sanjuoAuthor Commented:
Thank you all.

questions, I created sample COM Add-in.

Is there any possibility to break this addin?

Is it possible to lock worksheet, formula, VBA-Code fom this add-in? if yes How?

I mean is possible to protect worksheet, formula, VBA-code through coding instead of going to Tools>>Protection>>Protect_Worksheet ..... and so on
0
 
Richie_SimonettiIT OperationsCommented:
Yes, it is posssible but not a easy task.
Just a question, if you want to cerate an add-in, why to use macro code inside target workbook?
0
 
SteinerCommented:
@Richie:
>For the worksheet protection, it is harder but not impossible.
>Anyway, i only know brute-force approach to crack a protected worksheet.

This works at least for Excel97: Excel doesn't compare the whole password but a hash of the password. That way you'll have much less codes to try for a brute force to work. Usually I get a working password for a worksheet in just a few minutes...

Greets
Steiner
0
 
CleanupPingCommented:
Hi sanjuo,
This old question (QID 20569231) needs to be finalized -- accept an answer, split points, or get a refund.  Please see http://www.cityofangels.com/Experts/Closing.htm for information and options.
0
 
GrahamSkanRetiredCommented:
No comment has been added lately, so it's time to clean up this TA.
I will leave a recommendation in the Cleanup topic area that this question is:
 Split points between Richie_Simonetti, WintersVine and Steiner
Please leave any comments here within the next seven days.
 
PLEASE DO NOT ACCEPT THIS COMMENT AS AN ANSWER!
 
GrahamSkan
EE Cleanup Volunteer
0

Featured Post

Become an Android App Developer

Ready to kick start your career in 2018? Learn how to build an Android app in January’s Course of the Month and open the door to new opportunities.

  • 3
  • 2
  • 2
  • +3
Tackle projects and never again get stuck behind a technical roadblock.
Join Now