XL5: Application.OperatingSystem Returns Incorrect Value

Last reviewed: September 2, 1997
Article ID: Q111710
The information in this article applies to:
  • Microsoft Excel for Windows, version 5.0

SYMPTOMS

In Microsoft Excel 5.0 for Windows, the OperatingSystem property of the Application object returns the name and version number of the current operating system. Depending on the operating system you are using, this property may return incorrect results.

   Operating System             OperatingSystem Property Returns
   --------------------------------------------------------------

   Microsoft Windows for         3.10
   Workgroups version 3.11

   Microsoft Windows 95          Windows 3.95

   Microsoft Windows NT 3.51     Windows 3.10.

Example

When you run the following Visual Basic procedure to display the current operating system in a dialog box, Microsoft Windows version 3.11 will be incorrectly identified as version 3.10. It will be referred to as Windows 3.95 under Microsoft Windows 95, and Windows 3.10 under Microsoft Windows NT.

   Sub ShowOS()
      Msgbox Application.OperatingSystem
   End Sub

CAUSE

Microsoft Excel 5.0 for Windows uses a GetVersion Windows application programming interface (API) call that returns version 3.10 from the kernel. The version that the kernel reports was not changed for this version of Microsoft Windows for Workgroups. Because Microsoft Excel version 5.0 was designed for a 16-bit operating system, GetVersion makes a 16-bit .dll call that returns invalid data under a 32-bit operating system.

STATUS

Microsoft has confirmed this to be a problem in Microsoft Excel version 5.0. This problem was corrected in Microsoft Excel for Windows 95, version 7.0.

MORE INFORMATION

For additional information on running 16-bit versus 32-bit Microsoft Excel, please see the following article(s) in the Microsoft Knowledge Base:

   ARTICLE-ID: Q136147
   TITLE     : VB Macro to Tell If You Are Running 16-bit or 32-bit
               MS Excel

   ARTICLE-ID: Q131525
   TITLE     : Can't Run Macro That Calls 16-bit DLL in 32-bit MS Excel

REFERENCES

Microsoft Press: "Excel 5 Visual Basic for Applications Reference," page 460


Additional query words: 5.00
Keywords : kbprg PgmOthr
Version : 5.00
Platform : WINDOWS


THE INFORMATION PROVIDED IN THE MICROSOFT KNOWLEDGE BASE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. MICROSOFT DISCLAIMS ALL WARRANTIES, EITHER EXPRESS OR IMPLIED, INCLUDING THE WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT SHALL MICROSOFT CORPORATION OR ITS SUPPLIERS BE LIABLE FOR ANY DAMAGES WHATSOEVER INCLUDING DIRECT, INDIRECT, INCIDENTAL, CONSEQUENTIAL, LOSS OF BUSINESS PROFITS OR SPECIAL DAMAGES, EVEN IF MICROSOFT CORPORATION OR ITS SUPPLIERS HAVE BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. SOME STATES DO NOT ALLOW THE EXCLUSION OR LIMITATION OF LIABILITY FOR CONSEQUENTIAL OR INCIDENTAL DAMAGES SO THE FOREGOING LIMITATION MAY NOT APPLY.

Last reviewed: September 2, 1997
© 1998 Microsoft Corporation. All rights reserved. Terms of Use.