Article ID: 213496 - Last Review: June 11, 2007 - Revision: 4.6 XL2000: Macros to Return Windows and System Directory PathsThis article was previously published under Q213496 On This PageSUMMARY
In Microsoft Excel, there are no Microsoft Visual Basic for Applications functions to determine either your Windows or your Windows\System directory paths.
NOTE: It may be possible to work around this situation by creating a macro that makes calls to the Microsoft Windows application programming interface (API). This type of programming is supported by the Windows Software Development Kit (SDK) and the Visual Basic, Professional Edition, support groups. The level of support that you can receive from these groups depends on the individual support policies of the group. (Microsoft support engineers may not be able to assist in specific construction of macros that use API programming.) If you have limited programming experience, you may want to consult one of the Microsoft Solution Providers. Solution Providers offer a wide range of fee-based services, including the creation of custom macros. For more information about Microsoft Solution Providers, call Microsoft Customer Information Service at (800) 426-9400. MORE INFORMATIONMicrosoft 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 a Microsoft Certified Partner or Microsoft Advisory Services. For more information, visit these Microsoft Web sites: Microsoft Certified Partners - https://partner.microsoft.com/global/30000104 (https://partner.microsoft.com/global/30000104) Microsoft Advisory Services - http://support.microsoft.com/gp/advisoryservice (http://support.microsoft.com/gp/advisoryservice) For more information about the support options that are available and about how to contact Microsoft, visit the following Microsoft Web site:http://support.microsoft.com/default.aspx?scid=fh;EN-US;CNTACTMS (http://support.microsoft.com/default.aspx?scid=fh;en-us;cntactms) In Excel, you can create a macro to return the path to either the Windows or Windows\System directory by using the Declare functions to access built-in functions in Windows 3.1, Windows 95, Windows 98, Windows Millennium Edition (Me), Windows NT 3.51 and 4.0, and Windows 2000. The following macros use the GetWindowsDirectory and GetSystemDirectory function calls to retrieve the directory information that you want. Sample MacroREFERENCESFunction Reference, version 4.0, pages 42, 350 Online Help in the Microsoft Windows SDK
| Article Translations
|
Back to the top
