Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

Protecting Word-macro code

Posted on 1999-06-23
7
Medium Priority
?
138 Views
Last Modified: 2010-05-02
Hi there,

I have written a few macro´s under word97´s VBA, and want to hide my code from the users. Earlier this was possible with the MacroCopy-function, but this does not work any more. Is there someone who could help me on this...
0
Comment
Question by:sandloper
[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
  • 4
  • 2
7 Comments
 
LVL 22

Expert Comment

by:ture
ID: 1519233
sandloper,

1. Activate Visual Basic Editor
2. In the Project Window, select an object in the project you want to protect
3. Tools - Project Properties - Protection tab
4. Check "Lock project for viewing" and enter the same password twice in the textboxes below.
5. Click "OK"
6. Save - Close and reopen the file. It's locked!

Ture Magnusson
Karlstad, Sweden

0
 
LVL 13

Expert Comment

by:Mirkwood
ID: 1519234
I usually remove the VB editor menu item in the document.
The next time the document is loaded it will remove the menu item again. So people cannot read it...
0
 
LVL 22

Expert Comment

by:ture
ID: 1519235
Mirkwood,

Wouldn't that still keep the code visible if they access VBA through Alt+F11 or if they customize the menus or set them back to normal or show and use the Visual Basic toolbar?

/Ture
0
Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

 
LVL 13

Expert Comment

by:Mirkwood
ID: 1519236
Alt-F11 will be safe I think since the menu option is gone and therefor the accelerator should work anymore.
Remove the toolbar (button) too..
0
 
LVL 22

Expert Comment

by:ture
ID: 1519237
Sorry, Mirkwood.

Alt+F11 works even if the menu item is removed.

I beliebe it is easier to protect the code with the protection feature that is provided in VBE, the way I wrote in my comment.

Ture Magnusson
Karlstad, Sweden
0
 

Author Comment

by:sandloper
ID: 1519238
I have checked out your answers, and first of all whould just like to thank the two of you for the quick response.
I have checked out the proposed answers, and unfortunately I have to agree with Ture, the sollution given by Mirkwood does not work. I whould like to give the points to Ture becouse his sollution is working. How do I do this
0
 
LVL 22

Accepted Solution

by:
ture earned 120 total points
ID: 1519239
sandloper,

You are doing it right now... To give the points to someone else than the one who posted the answer:

1. Reject the answer with a comment why you reject it and (if someone else has posted a good solution) who you would like to get the points instead.

2. Wait for this person to post an answer.

3. Accept and grade that answer to release the points to this person.

----------------------------
Ok, here is my solution again. I am glad that it worked for you.

1. Activate Visual Basic Editor
2. In the Project Window, select an object in the project you want to protect
3. Tools - Project Properties - Protection tab
4. Check "Lock project for viewing" and enter the same password twice in the textboxes below.
5. Click "OK"
6. Save - Close and reopen the file. It's locked!

Ture Magnusson
Karlstad, Sweden
0

Featured Post

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Background What I'm presenting in this article is the result of 2 conditions in my work area: We have a SQL Server production environment but no development or test environment; andWe have an MS Access front end using tables in SQL Server but we a…
Since upgrading to Office 2013 or higher installing the Smart Indenter addin will fail. This article will explain how to install it so it will work regardless of the Office version installed.
Get people started with the process of using Access VBA to control Outlook using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Microsoft Outlook. Using automation, an Access applic…
This lesson covers basic error handling code in Microsoft Excel using VBA. This is the first lesson in a 3-part series that uses code to loop through an Excel spreadsheet in VBA and then fix errors, taking advantage of error handling code. This l…

715 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