Microsoft KB Archive/182811

= MacOFF: Programmatically Activating the Visual Basic Editor =

Article ID: 182811

Article Last Modified on 1/22/2007

-

APPLIES TO


 * Microsoft Excel 98 for Macintosh
 * Microsoft Excel 2001 for Mac
 * Microsoft Excel X for Mac
 * Microsoft PowerPoint 98 for Macintosh
 * Microsoft PowerPoint 2001 for Mac
 * Microsoft PowerPoint X for Mac
 * Microsoft Word 98 for Macintosh
 * Microsoft Word 2001 for Mac
 * Microsoft Word X for Mac

-



This article was previously published under Q182811



SUMMARY
You can programmatically switch to the Microsoft Visual Basic Editor from a Microsoft Office 98 program. This article includes macro examples that switch to Microsoft Visual Basic for Applications.



MORE INFORMATION
Microsoft provides programming examples for illustration only, without warranty either expressed or implied. This includes, but is not limited to, the implied warranties of merchantability or fitness for a particular purpose. This article assumes that you are familiar with the programming language that is being demonstrated and with the tools that are used to create and to debug procedures. Microsoft support engineers 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 requirements. In the following example, the MainWindow property returns a windows object that represents the main window of the Microsoft Visual Basic environment. The SetFocus method moves the focus to the object that is returned by the MainWindow property. Sub ShowVBE Application.VBE.MainWindow.SetFocus End Sub In the following example, the ShowVisualBasicEditor property switches to Microsoft Visual Basic. This macro applies only to Microsoft Word 98. Sub ShowWordVBE Application.ShowVisualBasicEditor = True End Sub

