Registrations are now open. Join us today!
There is still a lot of work to do on the wiki yet! More information about editing can be found here.
Already have an account?

Microsoft KB Archive/107703

From BetaArchive Wiki

Article ID: 107703

Article Last Modified on 10/10/2006



APPLIES TO

  • Microsoft Excel 97 Standard Edition
  • Microsoft Excel 98 for Macintosh



This article was previously published under Q107703

SUMMARY

In Microsoft Visual Basic for Applications, some Window properties, such as WindowHeadings, affect only the active worksheet in the window.

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. Window properties, such as scroll bars, gridlines, and worksheet tabs, can be turned on or off using Visual Basic commands. They are accessed as properties of the Window object. Some of these properties affect every worksheet in the window, while others affect only the active worksheet. This behavior is by design, and is consistent with the behavior of the Window Options setting. To set these options, click Options on the Tools menu, and click the View tab.

The following is a list of window properties that affect only the active worksheet in the window.

DisplayFormulas
DisplayGridlines
GridlineColor
DisplayHeadings
DisplayOutline
DisplayZeros


These properties are "per sheet-window" properties. To change these properties on each worksheet in the window, you must select each worksheet before changing the properties.

Steps to Reproduce Behavior

  1. Create a new workbook that contains at least two worksheets.
  2. Insert a new module, and then type the following code:

          Sub Window_Test()
              ' Activate first worksheet.
              ' Substitute name of first worksheet for "Sheet1."
              Sheets("Sheet1").Activate
              ' Turn off vertical scroll bar and row and column headings
              ' in active window.
              With ActiveWindow
                  .DisplayVerticalScrollbar = False
                  .DisplayHeadings = False
              End With
          End Sub
                            
  3. In Microsoft Excel 97 or Microsoft Excel 98 Macintosh Edition, point to Macro on the Tools menu, and then click Macros. In the Macro Name list, click to select Window_Test, and click Run.

    In Microsoft Excel 5.0 or 7.0, click Macro on the Tools menu, select Window_Test in the Macro Name/Reference list, and click Run.

    In the first sheet in your workbook, the vertical scroll bar and row and column headings are turned off.
  4. Select the second worksheet in your workbook.

    The vertical scrollbar is turned off in the second sheet of your workbook, but the row and column headers are still displayed. Although both are properties of the active window, DisplayHeadings only affects the active worksheet in the window, while DisplayVerticalScrollBar affects all worksheets in the window.


REFERENCES

Excel 97 and Excel 98 Macintosh Edition

For more information about the Window object, from the Visual Basic Editor, click the Office Assistant, type "window object," click Search, and then click to view "window object."

NOTE: If the Assistant is hidden, click the Office Assistant button on the Standard toolbar. If the Assistant is not able to answer your query, please see the following article in the Microsoft Knowledge Base:

176476 OFF: Office Assistant Not Answering Visual Basic Questions



Additional query words: 8.00 XL98 XL97 XL7 XL5 XL

Keywords: kbdtacode kbenv kbinfo kbprogramming KB107703