Microsoft KB Archive/185126: Difference between revisions
(importing KB archive) |
m (Text replacement - """ to """) |
||
Line 121: | Line 121: | ||
To edit the registry, run the RegEdit.exe utility. The LocalServer32 key for your ActiveX server are located in the HKEY_CLASSES_ROOT\CLSID section of the registry.<br /> | To edit the registry, run the RegEdit.exe utility. The LocalServer32 key for your ActiveX server are located in the HKEY_CLASSES_ROOT\CLSID section of the registry.<br /> | ||
<br /> | <br /> | ||
To locate the LocalServer32 key for your ActiveX server, choose Find from the Edit menu and specify the file name of your ActiveX server (or search on the ProgID). For example, to find the LocalServer32 key for Microsoft Excel, search for | To locate the LocalServer32 key for your ActiveX server, choose Find from the Edit menu and specify the file name of your ActiveX server (or search on the ProgID). For example, to find the LocalServer32 key for Microsoft Excel, search for "Excel.exe." You might need to press the F3 key to Find Next until you see the LocalServer32 key. For the case of Microsoft Excel, the LocalServer32 value might be: | ||
<div class="indent"> | <div class="indent"> | ||
Line 164: | Line 164: | ||
<li><p>Add the following code to the Form_Click event of Form1:</p> | <li><p>Add the following code to the Form_Click event of Form1:</p> | ||
<pre class="codesample"> Dim x as Object | <pre class="codesample"> Dim x as Object | ||
Set x = CreateObject( | Set x = CreateObject("Excel.Application") | ||
Msgbox x.Name | Msgbox x.Name | ||
</pre></li> | </pre></li> | ||
<li>Press the '''F5''' key to run the project and click the Form. Result: MsgBox displays | <li>Press the '''F5''' key to run the project and click the Form. Result: MsgBox displays "Microsoft Excel."<br /> | ||
<br /> | <br /> | ||
</li> | </li> | ||
Line 202: | Line 202: | ||
<div class="indent"> | <div class="indent"> | ||
[[../167591|167591]] ACC97: | [[../167591|167591]] ACC97: "Microsoft Access Can't Find the Wizard" Error Message | ||
Latest revision as of 12:38, 21 July 2020
Article ID: 185126
Article Last Modified on 2/12/2007
APPLIES TO
- Microsoft Office XP Developer Edition
- Microsoft Office 2000 Developer Edition
- Microsoft Visual Basic for Applications 5.0, when used with:
- Microsoft Windows NT 4.0
- Microsoft Visual Basic for Applications 6.0, when used with:
- Microsoft Windows NT 4.0
This article was previously published under Q185126
IMPORTANT: This article contains information about modifying the registry. Before you modify the registry, make sure to back it up and make sure that you understand how to restore the registry if a problem occurs. For information about how to back up, restore, and edit the registry, click the following article number to view the article in the Microsoft Knowledge Base:
256986 Description of the Microsoft Windows Registry
SYMPTOMS
When you try to start a (COM) Automation server or embed an OLE object, you may receive one of the following error messages:
Microsoft Visual Basic:
Microsoft Visual C++:
Microsoft Visual FoxPro:
Microsoft Office (OLE):
This problem only occurs on computers that are running Microsoft Windows NT 4.0.
CAUSE
This problem can occur if the ActiveX server is installed to a long folder path that may conflict with a similar path on the computer. Usually, the problem occurs when the path of the ActiveX server contains spaces and another path on the computer is the same, up to a space. For example, suppose you have this problem when you try to automate a Microsoft Office application. If you installed Microsoft Office to the default path:
C:\Program Files\Microsoft Office
and you also have a folder named C:\Program or C:\Program Files\Microsoft, you might experience this problem. A conflicting folder can also appear on a different drive.
RESOLUTION
Here are three resolutions:
- Reinstall the ActiveX server to a short folder path. For example, you can reinstall Microsoft Office to C:\Office97. To reinstall to a different path, you should first uninstall the application before reinstalling.
-or-
- Uninstall any applications that are installed in the conflicting folder (for example, C:\Program), and then delete or rename this folder so that it no longer conflicts. After you rename or delete this folder, you might need to re-register or reinstall your ActiveX server application to ensure it is properly registered.
-or-
- Edit the LocalServer32 key in the Registry for the ActiveX server application. The LocalServer32 key specifies the path to the ActiveX server. Change the path from a long path name to a short path name.
WARNING: If you use Registry Editor incorrectly, you may cause serious problems that may require you to reinstall your operating system. Microsoft cannot guarantee that you can solve problems that result from using Registry Editor incorrectly. Use Registry Editor at your own risk.
To edit the registry, run the RegEdit.exe utility. The LocalServer32 key for your ActiveX server are located in the HKEY_CLASSES_ROOT\CLSID section of the registry.
To locate the LocalServer32 key for your ActiveX server, choose Find from the Edit menu and specify the file name of your ActiveX server (or search on the ProgID). For example, to find the LocalServer32 key for Microsoft Excel, search for "Excel.exe." You might need to press the F3 key to Find Next until you see the LocalServer32 key. For the case of Microsoft Excel, the LocalServer32 value might be:
C:\Program Files\Microsoft Office\Office\excel.exe /automation
Assuming that the short path is C:\Progra~1\Micros~1\Office, you can change the LocalServer32 value to:
C:\Progra~1\Micros~1\Office\excel.exe /automation
You should only have to change one LocalServer32 key for your ActiveX server. To determine exactly what to specify for the short path, check the properties of the ActiveX server file in the Windows Explorer. See the MS- DOS name setting in the Properties window. Also check the properties of the folder in which the ActiveX server resides so that you can determine the complete short path of your ActiveX server.
Another way to determine the short path is to use the GetShortPathName API function. For additional information about using the GetShortPathName APIfunction, click the article number below to view the article in the Microsoft Knowledge Base:
175512 HOWTO: Get a Short Filename from a Long Filename
STATUS
Microsoft has confirmed this to be a bug in the Microsoft products listed at the beginning of this article.
MORE INFORMATION
Steps to Reproduce Behavior
- Install Microsoft Office 97 to C:\Program Files\Microsoft Office.
- In Visual Basic, start a new project.
Add the following code to the Form_Click event of Form1:
Dim x as Object Set x = CreateObject("Excel.Application") Msgbox x.Name
- Press the F5 key to run the project and click the Form. Result: MsgBox displays "Microsoft Excel."
- Stop the project.
- Create a new folder named C:\Program.
- Press the F5 key to run the project again, and click the Form.
Result: The CreateObject function fails with the following error:
REFERENCES
For additional information, please click the article numbers below to view the articles in the Microsoft Knowledge Base:
173430 Off97: Error Inserting an Office Object Under Windows NT 4.0
244264 INFO: Error 429 When Automating Office Applications
167591 ACC97: "Microsoft Access Can't Find the Wizard" Error Message
189366 ACC97: Run-Time Error 429 Message Using Run-Time Application
Additional query words: GetObject instantiate COM CoCreateInstance 429 53 0x80070003
Keywords: kbbug kboleapp kbpending KB185126