Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 15
Default "Protecting" VBA macro from source reading...

Hi,

Is there any way to protect VBA macro from source code reading and
modification? Is only way to do is to wrap as COM object?

Thanks for your time.

- KA
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 367
Default "Protecting" VBA macro from source reading...

When you are in the VB-Editor, go to tools -- VBA project properties
and there you have a Tab security where you can enter a password.
How secure this is...don't ask me, but you sure can find some infos
about that on google.

hth

Carlo

On Nov 26, 5:08 pm, Kedar Agarkar wrote:
Hi,

Is there any way to protect VBA macro from source code reading and
modification? Is only way to do is to wrap as COM object?

Thanks for your time.

- KA


  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 7,247
Default "Protecting" VBA macro from source reading...

In the VBA Editor, choose VBA Project Properties, then the Protection tab.
There, check "Lock project for viewing", enter a password (twice) and then
save the workbook. Note that this level of security is notoriously weak.
There are many password breakers readily available on the net. I use VBAKey
from Passware (about $40) and it can crack any VBA project password in a
matter of seconds. (As an aside, VBAKey doesn't necessarily return the
actual password used on the project. Instead, it finds a password that will
unlock the project, which is not necessarily the actual password used.)

You should think of VBA protection as a mechanism to prevent the honest user
from making honest mistakes. It should not be used to protect proprietary
data or code with intellectual property value. If you really need to lock
down the code, you should write a COM Add-In or an Automation Add-In in VB6
or NET. See http://www.cpearson.com/Excel/CreatingCOMAddIn.aspx and
http://www.cpearson.com/Excel/AutomationAddIns.aspx and
http://www.cpearson.com/Excel/Creati...nctionLib.aspx for example code.
With these types of add-ins, no source code is ever distributed to the
user -- only compiled machine code or MSIL is distributed to the end user--
so you don't have to worry about users viewing and/or modifying code.


--
Cordially,
Chip Pearson
Microsoft MVP - Excel, 10 Years
Pearson Software Consulting
www.cpearson.com
(email on the web site)



"Kedar Agarkar" wrote in message
...
Hi,

Is there any way to protect VBA macro from source code reading and
modification? Is only way to do is to wrap as COM object?

Thanks for your time.

- KA


  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 15
Default "Protecting" VBA macro from source reading...

Chip and Carlo, thanks much about your very useful elaboration.

Shall be certainly of help to me.

Thanks both for your time.

- Kedar

On Nov 26, 6:47 pm, "Chip Pearson" wrote:
In the VBA Editor, choose VBA Project Properties, then the Protection tab.
There, check "Lock project for viewing", enter a password (twice) and then
save the workbook. Note that this level of security is notoriously weak.
There are many password breakers readily available on the net. I use VBAKey
from Passware (about $40) and it can crack any VBA project password in a
matter of seconds. (As an aside, VBAKey doesn't necessarily return the
actual password used on the project. Instead, it finds a password that will
unlock the project, which is not necessarily the actual password used.)

You should think of VBA protection as a mechanism to prevent the honest user
from making honest mistakes. It should not be used to protect proprietary
data or code with intellectual property value. If you really need to lock
down the code, you should write a COM Add-In or an Automation Add-In in VB6
or NET. Seehttp://www.cpearson.com/Excel/CreatingCOMAddIn.aspxandhttp://www.cpearson.com/Excel/AutomationAddIns.aspxandhttp://www.cpearson.com/Excel/CreatingNETFunctionLib.aspxfor example code.
With these types of add-ins, no source code is ever distributed to the
user -- only compiled machine code or MSIL is distributed to the end user--
so you don't have to worry about users viewing and/or modifying code.

--
Cordially,
Chip Pearson
Microsoft MVP - Excel, 10 Years
Pearson Software Consultingwww.cpearson.com
(email on the web site)

"KedarAgarkar" wrote in message

...



Hi,


Is there any way to protect VBA macro from source code reading and
modification? Is only way to do is to wrap as COM object?


Thanks for your time.


- KA- Hide quoted text -


- Show quoted text -


  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 6,582
Default "Protecting" VBA macro from source reading...

While this kind of protection is notoriously insecure, I find it is pretty
effective. When I tell a client that the project is password protected, they
just assume I'm all-powerful and don't even seem to consider that it can be
bypassed. (I usually send an unlocked version after they pay my invoice.)

- Jon
-------
Jon Peltier, Microsoft Excel MVP
Tutorials and Custom Solutions
Peltier Technical Services, Inc. - http://PeltierTech.com
_______


"Chip Pearson" wrote in message
...
In the VBA Editor, choose VBA Project Properties, then the Protection tab.
There, check "Lock project for viewing", enter a password (twice) and then
save the workbook. Note that this level of security is notoriously weak.
There are many password breakers readily available on the net. I use
VBAKey from Passware (about $40) and it can crack any VBA project password
in a matter of seconds. (As an aside, VBAKey doesn't necessarily return
the actual password used on the project. Instead, it finds a password that
will unlock the project, which is not necessarily the actual password
used.)

You should think of VBA protection as a mechanism to prevent the honest
user from making honest mistakes. It should not be used to protect
proprietary data or code with intellectual property value. If you really
need to lock down the code, you should write a COM Add-In or an Automation
Add-In in VB6 or NET. See
http://www.cpearson.com/Excel/CreatingCOMAddIn.aspx and
http://www.cpearson.com/Excel/AutomationAddIns.aspx and
http://www.cpearson.com/Excel/Creati...nctionLib.aspx for example
code. With these types of add-ins, no source code is ever distributed to
the user -- only compiled machine code or MSIL is distributed to the end
user-- so you don't have to worry about users viewing and/or modifying
code.


--
Cordially,
Chip Pearson
Microsoft MVP - Excel, 10 Years
Pearson Software Consulting
www.cpearson.com
(email on the web site)



"Kedar Agarkar" wrote in message
...
Hi,

Is there any way to protect VBA macro from source code reading and
modification? Is only way to do is to wrap as COM object?

Thanks for your time.

- KA




Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Protecting/Unprotecting all sheets with macro leads to "image" iss MikeR Excel Worksheet Functions 3 February 22nd 10 09:33 PM
why do i "sometimes" need to "edit chart object" before "source da Flirty and Blonde Charts and Charting in Excel 1 February 2nd 10 02:07 PM
Multiple "source" workbooks linked to single "destination" workboo DAVEJAY Excel Worksheet Functions 1 September 17th 07 05:33 PM
XSLT XML Mapping Excel "Map Each Element" "XML Source" [email protected][_2_] Excel Programming 0 July 26th 07 01:25 AM
Help with VBA Macro Reading Excel "form" DTTODGG Excel Programming 2 March 8th 06 06:47 PM


All times are GMT +1. The time now is 12:35 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"