?
Solved

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

Posted on 2003-03-31
11
Medium Priority
?
269 Views
Last Modified: 2010-04-07
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
Comment
Question by:sanjuo
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
  • 2
  • 2
  • +3
11 Comments
 
LVL 16

Accepted Solution

by:
Richie_Simonetti earned 168 total points
ID: 8242220
Mostly of them could be done protecting the worksheet.
For Code, you could use a password for the project.
0
 
LVL 2

Assisted Solution

by:WintersVine
WintersVine earned 168 total points
ID: 8242668
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
 
LVL 2

Expert Comment

by:WintersVine
ID: 8242669
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
Industry Leaders: 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!

 
LVL 11

Assisted Solution

by:Steiner
Steiner earned 164 total points
ID: 8243722
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
 
LVL 16

Expert Comment

by:Richie_Simonetti
ID: 8246108
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
 

Author Comment

by:sanjuo
ID: 8248421
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
 
LVL 16

Expert Comment

by:Richie_Simonetti
ID: 8248865
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
 
LVL 11

Expert Comment

by:Steiner
ID: 8251629
@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
 

Expert Comment

by:CleanupPing
ID: 8531248
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
 
LVL 76

Expert Comment

by:GrahamSkan
ID: 8983854
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

Industry Leaders: 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!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Enums (shorthand for ‘enumerations’) are not often used by programmers but they can be quite valuable when they are.  What are they? An Enum is just a type of variable like a string or an Integer, but in this case one that you create that contains…
With User Account Control (UAC) enabled in Windows 7, one needs to open an elevated Command Prompt in order to run scripts under administrative privileges. Although the elevated Command Prompt accomplishes the task, the question How to run as script…
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…
Suggested Courses

777 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question