J
James
I am doing some Excel 2000 automaton using Vb 2005. I am referencing
the Excel 9.0 COM Object Library.
The following code was working fine:
Dim xlApp as new Excel.Application
Dim xlWb as Excel.Workbook
Dim xlSheet as Excel.Worksheet
xlWb = xlApp.Workbooks.Add
xlSheet = xlWb.Worksheets(1)
<some code here >
xlApp.Quit()
The only problem was that Excel.exe would continue in the task manager
after the code was complete.
I followed this link to try to fix the problem:
http://support.microsoft.com/default.aspx?scid=kb;en-us;317109
The above link suggested the following:
Note If you have not already done so, it is recommended that you
download and install the Microsoft Office XP Primary Interop Assemblies
(PIAs).
http://support.microsoft.com/kb/328912/
I downloaded and registered the PIAs. Now my old code will not run.
xlWb = xlApp.Workbooks.Add now gives the following error:
Unable to cast COM object of type
'Microsoft.Office.Interop.Excel.ApplicationClass'
to interface type 'Excel.Application'. This operation failed because
the QueryInterface
call on the COM component for the interface with IID
'{000208D5-0000-0000-C000-000000000046}'
failed due to the following error: Library not registered.
(Exception from HRESULT: 0x8002801D (TYPE_E_LIBNOTREGISTERED)).
Could it be that the PIAs I downloaded replaced the Excel 9.0 Object
Library with the 10.0 object library? Any Idea how to get back to
where I was? Do I need to re-install Excel 2000? Re-install VS 2005?
Thanks very much,
James
the Excel 9.0 COM Object Library.
The following code was working fine:
Dim xlApp as new Excel.Application
Dim xlWb as Excel.Workbook
Dim xlSheet as Excel.Worksheet
xlWb = xlApp.Workbooks.Add
xlSheet = xlWb.Worksheets(1)
<some code here >
xlApp.Quit()
The only problem was that Excel.exe would continue in the task manager
after the code was complete.
I followed this link to try to fix the problem:
http://support.microsoft.com/default.aspx?scid=kb;en-us;317109
The above link suggested the following:
Note If you have not already done so, it is recommended that you
download and install the Microsoft Office XP Primary Interop Assemblies
(PIAs).
http://support.microsoft.com/kb/328912/
I downloaded and registered the PIAs. Now my old code will not run.
xlWb = xlApp.Workbooks.Add now gives the following error:
Unable to cast COM object of type
'Microsoft.Office.Interop.Excel.ApplicationClass'
to interface type 'Excel.Application'. This operation failed because
the QueryInterface
call on the COM component for the interface with IID
'{000208D5-0000-0000-C000-000000000046}'
failed due to the following error: Library not registered.
(Exception from HRESULT: 0x8002801D (TYPE_E_LIBNOTREGISTERED)).
Could it be that the PIAs I downloaded replaced the Excel 9.0 Object
Library with the 10.0 object library? Any Idea how to get back to
where I was? Do I need to re-install Excel 2000? Re-install VS 2005?
Thanks very much,
James