LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Library not registered. (Exception from HRESULT: 0x8002801D (TYPE_

My current code ran in VS2003 on a XPpro machine. I transferred it to a Vista
machine and had to purchase VS2005 . I made the changes and the code ran. I
made additions over several weks and the code still ran . I did not run the
code a gain for about a month and then the code would not run on the Vista
machine so I installed VS2005 on an XPpro PC and the same then code compiiles
and runs fine.


Both PCs have Ofiice 2003 Pro on them and no other versions of Excel or
office.



It as if one of the MS regular Vista updates made a change causing the code
not to compile.



My code is in Visaul Basic



These are the first lines of the code



Imports System.IO

Imports System.IO.StreamReader

Imports System

Imports System.Threading

Imports System.text.regularexpressions

Imports System.Text

Imports System.Globalization

Imports System.Collections

Imports Microsoft.Office.interop.excel

Imports Excel = Microsoft.Office.Interop.Excel

Imports System.Reflection

Imports System.Runtime.InteropServices



The lines following this are Windows Form Designer Generated code (about
2000 of them ) Total program is about 9000 lines



Dim ExcelScheduler As New Excel.Application

Dim ExcelWB As Excel.Workbook =
ExcelScheduler.Workbooks.Open("C:\ExactaRecords\Sc heduler.xls")

Dim ScheduleSheet1 As Excel.Worksheet = ExcelWB.Sheets(1)

Dim ScheduleSheet2 As Excel.Worksheet = ExcelWB.Sheets(2)

Dim ScheduleSheet3 As Excel.Worksheet = ExcelWB.Sheets(3)



ScheduleSheet1 = ExcelWB.Worksheets(1)

ScheduleSheet2 = ExcelWB.Worksheets(2)

ScheduleSheet3 = ExcelWB.Worksheets(3)



This is the error message:



System.InvalidCastException occurred
Message="Unable to cast COM object of type
'Microsoft.Office.Interop.Excel.ApplicationClass' to interface type
'Microsoft.Office.Interop.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))."
Source="Microsoft.Office.Interop.Excel"
StackTrace:
at Microsoft.Office.Interop.Excel.ApplicationClass.ge t_Workbooks()
at ShowTimeScheduler.ShowTimeDirector..ctor() in
C:\ShowTimeScheduler\Backup\ShowTimeDirector.vb:li ne 2222


Error occurs at the line :



Dim ExcelWB As Excel.Workbook =
ExcelScheduler.Workbooks.Open("C:\ExactaRecords\Sc heduler.xls")





Does any one have any ideas how to fix this problem?

Thanks




 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Exception from HRESULT: 0x800A03EC Samir1014 Excel Programming 2 September 13th 07 07:14 PM
Exception from HRESULT: 0x800401A8 Miles Excel Programming 1 February 12th 07 02:03 PM
Exception from HRESULT: 0x800A03EC nano2k New Users to Excel 0 July 21st 06 12:15 PM
Exception from HRESULT: 0x800AC472 [email protected] Excel Discussion (Misc queries) 0 May 30th 06 09:01 PM
Exception HResult: 0x8007FA08 (VB.net) prashanth Kotha Excel Programming 0 August 20th 03 07:27 PM


All times are GMT +1. The time now is 05:22 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"