Microsoft KB Archive/104358

{| = Excel: Errors Using SWITCH.XLA Buttons to Start Applications =
 * width="100%"|

Last reviewed: September 12, 1996

Article ID: Q104358 The information in this article applies to:
 * Microsoft Excel for Windows, versions 4.0, 4.0a

SYMPTOMS
When you run an application from a button installed with the SWITCH.XLA add-in macro, you may receive the following error messages:

Cannot find Microsoft Word directory in MS-DOS PATH= statement. Check AUTOEXEC.BAT making sure the Microsoft Word is in the PATH= statement.

Cannot find Microsoft Project directory in MS-DOS PATH= statement. Check AUTOEXEC.BAT making sure the Microsoft Project is in the PATH= statement.

Cannot find Microsoft PowerPoint directory in MS-DOS PATH= statement. Check AUTOEXEC.BAT making sure the Microsoft PowerPoint is in the PATH= statement.

CAUSE
The above errors are caused by an incorrect [Extensions] setting in your WIN.INI file (the path to Word, PowerPoint, or Microsoft Project may be incorrect).

WORKAROUND
To work around this problem:

 Open your WIN.INI file in a text editor (such as Notepad). Locate the [Extensions] section of the WIN.INI file.  Verify that the paths for Word, PowerPoint, and Microsoft Project are all entered correctly. For example, this section of your WIN.INI might resemble the following: [Extensions] doc=C:\WINWORD\WINWORD.EXE ^.doc mpp=C:\WINPROJ\WINPROJ.EXE ^.mpp ppt=C:\POWERPNT\POWERPNT.EXE ^.ppt  Save any changes.

MORE INFORMATION
The SWITCH.XLA add-in macro adds the toolbar buttons to the toolbar and assigns a macro to each of them which points to the SWITCHTO.XLA macro sheet. These macros are then executed whenever the toolbar buttons are selected. However, the macro code does not rely on the PATH statement to launch the application (as the error messages indicate). Instead, the macro uses DDE calls to the Windows kernel to return the path of the application. These calls to the kernel use the file association information found in the WIN.INI file under the [Extensions] section.