We help IT Professionals succeed at work.
Get Started

!!! Program opening an *xls file protected with a (for me known) open-password !!!

miua
miua asked
on
198 Views
Last Modified: 2010-05-03
Hi there,

I need help with creating a small program in VB that should do the following actions (in written order):

1) to initiate opening a "SomeName.xls" file that would be located in the same directory as required program
2) to choose an option "allow macros" in MS Excel for the considered "SomeName.xls" file - NOT NECCESSARY
3) "enter" the password neccessary for opening the "SomeName.xls" file  (Only I know the password)

Users shouldn´t notice 2) and 3) action.

You may want to know why....

Don´t be afraid - no viruses... :-)  I created an "SomeName.xls" file that helps users to do some specific calculations and I would like to try to sell it for some small fee (I worked on it a lot!!! of hours). The calculations are partially made via macros. There are also some macros guarding the legality of using the file (in Sub Workbook_Open).  So the VBA project must be as safe as possible - but only the password of the VBA project isn´t sufficient (there are easily aproachable programs that can delete/modify this VBAproject-password). But when there is also an long password (e.g. 123hiTHERE456) to open the *.xls file, those password recovery programs have to use brute attack which isn´t for long open-passwords seccesfull..
I see the proposed way as relatively easy solution to minimaze the threat of the password recovery programs.

I have never made a program in Visual Basic so it is a big problem for me... So if you could provide me with the code I would be extremely greatful

Thank you.
Comment
Watch Question
CERTIFIED EXPERT
Distinguished Expert 2020
Commented:
This problem has been solved!
Unlock 1 Answer and 3 Comments.
See Answer
Why Experts Exchange?

Experts Exchange always has the answer, or at the least points me in the correct direction! It is like having another employee that is extremely experienced.

Jim Murphy
Programmer at Smart IT Solutions

When asked, what has been your best career decision?

Deciding to stick with EE.

Mohamed Asif
Technical Department Head

Being involved with EE helped me to grow personally and professionally.

Carl Webster
CTP, Sr Infrastructure Consultant
Ask ANY Question

Connect with Certified Experts to gain insight and support on specific technology challenges including:

  • Troubleshooting
  • Research
  • Professional Opinions
Did You Know?

We've partnered with two important charities to provide clean water and computer science education to those who need it most. READ MORE