Microsoft KB Archive/141787

From BetaArchive Wiki

Microsoft Knowledge Base

MXL5: MacID Help Lists Incorrect Constant

Last reviewed: September 12, 1996
Article ID: Q141787

The information in this article applies to:

  • Microsoft Excel for the Macintosh, version 5.0

SUMMARY

In Microsoft Excel, Visual Basic Help contains incorrect information about the constant argument for Microsoft Excel. For example, Help contains the following information:

   The constant named argument consists of four-characters used to specify
   a resource type, file type, application signature, or Apple Event. For
   example, TEXT, OBIN, MSWD (Microsoft Word), XCEL (Microsoft Excel), and
   so on.

This information is not entirely correct: this example should include XLS5 (Microsoft Excel 5 file type). The constant argument for Microsoft Excel is the Application Signature for Microsoft Excel versions 5.0 and earlier and the File Type for Microsoft Excel versions 4.0 and earlier. However, Microsoft Excel 5.0 has a different File Type constant argument; the File Type argument for Microsoft Excel 5.0 is XLS5.

In addition, the following information is included in the MacID function example in Help:

   ' Run Microsoft Excel.
   ReturnValue = Shell(MacID("XCEL"))

This example will cause a "Run-Time error '68': Device unavailable" error, because a second instance of Microsoft Excel cannot be started from within Microsoft Excel.

MORE INFORMATION

The XCEL constant is used with the Shell statement and the AppActivate statement. The XLS5 constant is used with the Dir function and the Kill statement.

Examples That Demonstrate the Use of These Constants

' Return the first Excel 5 file in folder HD:My Folder.

FileName = Dir("HD:My Folder:", MacID("XLS5"))

' Return the first Excel 4 or prior file in folder HD:My Folder.

FileName = Dir("HD:My Folder:", MacID("XCEL"))

' Deletes all Excel 5 files in the current folder.

Kill MacID("XLS5")

' Deletes all Excel 4 or prior files in the current folder.

Kill MacID("XCEL")

' Activate Microsoft Excel.

AppActivate MacID("XCEL")

NOTE: These constants are case sensitive and should be typed in uppercase letters.


KBCategory: kbdocerr

KBSubcategory: xlmac

Additional reference words: 5.00



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 12, 1996
©1997 Microsoft Corporation. All rights reserved. Legal Notices.