Securing Visual Basic Code in Microsoft Excel (167909)
The information in this article applies to:
- Microsoft Excel 97 for Windows
- Microsoft Excel for Windows 95
- Microsoft Excel for Windows 5.0
This article was previously published under Q167909 SUMMARY
In Microsoft Excel 97, unlike earlier versions of Microsoft Excel, you
cannot hide Visual Basic for Applications modules. If you want to prevent
users from seeing Visual Basic code, you can lock the Visual Basic project
in the workbook and prevent users from viewing it. However, if you save
the workbook in either the Microsoft Excel 5.0/95 or the Microsoft Excel
97 & 5.0/95 file format, the module protection is lost when you open the
workbook in Microsoft Excel 5.0 or 7.0. Therefore, to use this method, you
must maintain separate versions of the workbook for users of Microsoft
Excel 97 and users of Microsoft Excel 5.0 and 7.0.
This article describes a method of protecting Visual Basic code while
allowing users of different versions of Microsoft Excel to use the same
version of your application. This method requires that you create the
application in Microsoft Excel 5.0 or 7.0 and then save it as an add-in
file. This method hides the code in all versions of Microsoft Excel. Any
add-in code you create in Microsoft Excel 5.0 or 7.0 is not visible when
the file is opened in Microsoft Excel 97.
REFERENCES
"Visual Basic User's Guide," version 5.0, Chapter 13, "Converting a
Workbook to an Add-in Application"
For more information about creating add-ins in Microsoft Excel 7.0, click
the Index tab in Microsoft Excel Help, type the following text
add-ins, creating in Visual Basic
and then double-click the selected text to go to the "What is an add-in
application, and where can I learn more about add-ins?" topic.
| Modification Type: | Minor | Last Reviewed: | 8/17/2005 |
|---|
| Keywords: | kbhowto kbmacro kbProgramming kbui KB167909 |
|---|
|