The information in this article applies to:
SYMPTOMSIn the versions of Microsoft Excel listed at the beginning of this article, if you run a Microsoft Excel macro or a Visual Basic for Applications macro, you may receive an error message similar to either of the following:
-or-
CAUSEThis problem may occur if the macro contains code that saves a workbook by using an MS-DOS path and file name, as in the following examples:
WORKAROUNDMicrosoft provides programming examples for illustration only, without warranty either expressed or implied, including, but not limited to, the implied warranties of merchantability and/or fitness for a particular purpose. This article assumes that you are familiar with the programming language being demonstrated and the tools used to create and debug procedures. Microsoft support professionals 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 needs. If you have limited programming experience, you may want to contact the Microsoft fee-based consulting line at (800) 936-5200. For more information about the support options available from Microsoft, please see the following page on the World Wide Web: http://www.microsoft.com/support/supportnet/overview/overview.aspTo work around this problem, make sure that your macro is designed to account for differences between the Microsoft Windows and Macintosh operating systems. One way to do this is to use the Application.OperatingSystem property to determine whether you are on a computer running Windows or on a computer running the Macintosh operating system, for example:
If you are using the Microsoft Excel (XLM) macro language, the code to use
is the following:
STATUSThis behavior is by design of the versions of Microsoft Excel listed at the beginning of this article. MORE INFORMATIONIn Microsoft Windows and Microsoft Windows NT, path names for files include both colons (:) and backslashes (\), for example: C:\Data\Test.xlsThe colon separates the disk drive letter from the remainder of the path, which uses backslashes to separate folder names from the file name. On the Macintosh, path names for files use only colons, for example: Data:Test.xlsIf you attempt to use a MS-DOS file name in a macro on the Macintosh, you may receive an error message similar to one of those in the "Symptoms" section in this article. This behavior occurs because the folder name "C" (from "C:\Data\Test.xls") usually does not exist on a hard disk on a Macintosh computer. Additional query words: XL5 offvba
Keywords : kbcode kberrmsg kbprg xlvbainfo |
Last Reviewed: November 9, 1999 © 2000 Microsoft Corporation. All rights reserved. Terms of Use. |