OFF97: Visual Basic Modules Cannot Be Hidden or ProtectedID: Q156879
|
In the programs listed at the beginning of this article, you cannot hide or protect a module either manually or by using a macro.
This behavior is by design of the programs listed above. 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 using the Visible, Protect, or Unprotect commands in a macro.
However, in Microsoft Excel 97, Microsoft Word 97, and Microsoft
PowerPoint 97, 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.
To hide or protect a module in Microsoft Excel 97, 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 97, follow these steps:
Microsoft provides programming examples for illustration only, without warranty either expressed or implied, including, but not limited to, the implied warranties of merchantability and/or fitness for a particular purpose. This article assumes that you are familiar with the programming language being demonstrated and the tools used to create and debug procedures. Microsoft support professionals can help explain the functionality of a particular procedure, but they will not modify these examples to provide added functionality or construct procedures to meet your specific needs. If you have limited programming experience, you may want to contact the Microsoft fee-based consulting line at (800) 936-5200. For more information about the support options available from Microsoft, please see the following page on the World Wide Web:
http://www.microsoft.com/support/supportnet/refguide/The following sample procedures are provided to further clarify the difference between hiding modules in Microsoft Excel 5.0, 7.0, and 97.
Sub HideMe()
ThisWorkbook.Modules("Module1").Visible = False
End Sub
Sub ShowMe()
ThisWorkbook.Modules("Module1").Visible = True
End Sub
Sub ReallyHideModule2()
ThisWorkbook.Modules("Module2").Visible = xlVeryHidden
End Sub
Microsoft Excel 5.0 and 7.0:
Additional query words: XL97 addin 8.0 WD97 PP97
Keywords : kbcode xlui xladdins xlvbmigrate
Version : WINDOWS:97
Platform : WINDOWS
Issue type : kbprb
Last Reviewed: July 2, 1999