Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How do I lock a VBA project

Status
Not open for further replies.

DrNeilC

Technical User
Nov 21, 2011
1
ID
I would like to be able to lock and hide my vba code so that nobody can tamper or edit the code. I know I can use a VBA passowrd but this is easy to remove or crack, so I was wondered if there was an alternative which is more secure. Any thoughts
 
Not quite sure how one converts a VBA project into a COM add-in without rewriting it in a different language
 
I suspected that's what you meant. I'm well aware how to create COM addins in VB6. My point is that your answer to "how do lock and hide my VBA code" conceals the fact that you are actually saying use a different language - worse, it is recommending without any caveats a language and development platform that you cannot actually buy anymore.

>Conversion to vb (eg vb6) might be relatively straightforward

I'm not convinvced. There's quite a lot of reworking that would need to be done.

> info on creating them via vb6

Sure. Creating them from scratch in VB6 is a somewhat different matter
 
Hi strongm,

I agree it's technically a different language, but much of the code is likely to be portable to Visual Studio, VB6's sucessor (I've done some of this myself). Having to recreate from scratch is unlikely.

Cheers
Paul Edstein
[MS MVP - Word]
 
> Visual Studio, VB6's sucessor

To be pedantic, Visual Studio is not a successor to VB6

VB.NET is the successor, which has since been rebranded simply as VB 2KX, and is a componetn of Visual Studio 2KX, just as VB6 was a component of Visual Studio 6.

But can we just check - you've now decided the OP probably needs to move to VB 2005/2008? And then write a COM add-in in a language that is essentially COM hostile?

>Having to recreate from scratch is unlikely

My point was that recreating from scratch is often the easiest option for all but the simplest projects when moving from VB6 (or VBA) to VB.NET
 
Just a minor quibble:
DrNeilC said:
I can use a VBA passowrd but this is easy to remove or crack

Is it?
I know there is software available that will do it, but, and I'm making a fairly big assumption here, if you're in a "business" environment, would that software exist on people's machines? If all you're doing is trying to stop "meddling", then the VBA password is more than adequate IMHO. If you're trying to protect intellectual property, then a full COM component would be my recommendation.

hth

Ben

----------------------------------------------
Ben O'Hara
David W. Fenton said:
We could be confused in exactly the same way, but confusion might be like Nulls, and not comparable.
 
>Is it?

It only takes a single byte change, for all versions of Excel (and other Office applications) subsequent to Excel 97 up to and including Excel 2010.

I concur with the COM idea
 
strongm said:
It only takes a single byte change

Well I never!
I stand by my comment that if it's only to prevent users meddling, it's good enough.

----------------------------------------------
Ben O'Hara
David W. Fenton said:
We could be confused in exactly the same way, but confusion might be like Nulls, and not comparable.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top