OFF98: Visual Basic Modules Cannot Be Hidden or Protected (183534)
The information in this article applies to:
- Microsoft Office 98 Macintosh Edition
- Microsoft Excel 98 Macintosh Edition
- Microsoft Word 98 Macintosh Edition
- Microsoft PowerPoint 98 Macintosh Edition
This article was previously published under Q183534 SYMPTOMS
In the programs listed at the beginning of this article, you cannot hide or
protect a module either manually or by using a macro.
CAUSE
This behavior is by design of the programs listed at the beginning of this
article. In earlier versions of Microsoft Excel, macro sheets and Visual
Basic modules are contained on tabs in a workbook. These tabs can be hidden
or protected manually or by using the Visible, Protect, or Unprotect
commands in a macro.
However, in Microsoft Excel 98, Microsoft Word 98, and Microsoft
PowerPoint 98, Visual Basic modules are displayed in the Visual Basic
Editor. Modules in the Visual Basic Editor cannot be hidden or protected in
the same way that they were hidden or protected in earlier versions of
Microsoft Excel.
WORKAROUND
To hide or protect a module in Microsoft Excel 98, create an add-in file.
When you open an add-in file, it is not possible to view the module it
contains, and code in the add-in cannot be viewed or modified.
To make an add-in file in Microsoft Excel 98, follow these steps:
- In the Visual Basic Editor, click <Project Name> Properties on the Tools
menu, where <Project Name> is the name of the project for which you are
creating an add-in.
- Click the Protection tab.
- Click the "Lock Project for Viewing" check box. Type a password in the
Password box, and then type the password again in the Confirm Password
box.
- Click OK.
- On the File menu, click "Close and Return To Microsoft Excel."
- In Microsoft Excel, click Save As on the File menu.
- In the Save As Type box, click Microsoft Excel Add-In or Microsoft
Excel Workbook.
If you want to change the name of the file, change it in the File Name
box.
- Click Save.
Note that if you saved the file as an add-in, when you open the add-in, no
window appears, and you cannot unhide the add-in. To view a module in the
add-in or the workbook, follow these steps:
- On the Tools menu, point to Macro, and then click Visual Basic Editor.
- In the Visual Basic Editor, click the entry for the add-in in the
Project pane.
- When you are prompted, type the password for the add-in, and then click
OK.
You can now view a module in the add-in or workbook and make changes to
your macro code.
Modification Type: | Major | Last Reviewed: | 6/18/2005 |
---|
Keywords: | kbbug kbpending kbProgramming KB183534 |
---|
|