Workspace Doesn't Retain Window Size (160264)



The information in this article applies to:

  • Microsoft Excel 97 for Windows
  • Microsoft Excel for Windows 95
  • Microsoft Excel for Windows 5.0
  • Microsoft Excel 98 Macintosh Edition

This article was previously published under Q160264

SYMPTOMS

When you open a workspace (*.xlw) file in Microsoft Excel, the window state is not retained. Instead, the windows appear in the restored state.

CAUSE

This problem occurs when you maximize the windows in a workspace, save the workspace file, and then reopen the file.

WORKAROUND

To open a workspace file with maximized windows, use either of the following methods:

  • Manually maximize the active window by clicking the Maximize button in the upper-right corner of the document window.

    -or-
  • Create a Visual Basic for Applications macro that automatically maximizes the active window when you open the workbook.

Macro Example

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. The following sample macro runs automatically when you open the workbook, and maximizes the window.

   Sub Auto_Open()
       ActiveWindow.WindowState = xlMaximized
   End Sub
				



Modification Type:MinorLast Reviewed:8/17/2005
Keywords:kbcode kbprb kbProgramming kbualink97 KB160264