Worksheet: Klasse nicht registriert (Ausnahme von HRESULT: 0x80040154 (REGDB_E_CLASSNOTREG))

Nov 26, 2014 at 1:36 PM
Edited Nov 26, 2014 at 1:38 PM

I have a strange problem I can't resolve. On my local maschine an some others my code is working fine. If I try to use it at a Windows 2003 Server I have a problem to get an instance of Worksheet.

I use VS 2010 and my application is written in VB.NET 3.5. I use NetOffice 1.7.2

Here is what I'm doing. It is very simple and really no magic:
Imports NetOffice
Imports Excel = NetOffice.ExcelApi
Dim lobjExcel As Excel.Application = New Excel.Application()
Dim lobjWorkbook As Excel.Workbook = lobjExcel.Workbooks.Add()
log.Debug(lobjWorkbook.Worksheets.ToString()) --> Output is Sheets
Every of the following line is crashing (tried them seperatly):
Dim sheet As Excel.Worksheet = lobjExcel.Workbooks(1).Worksheets(1)
Dim sheet As Excel.Worksheet = lobjWorkbook.Worksheets(1)
Dim sheet As Excel.Worksheet = lobjWorkbook.Sheets(1)
Exception Message:
bei NetOffice.IDispatch.GetTypeInfo(Int32 iTInfo, Int32 lcid)
bei NetOffice.Core.GetParentLibraryGuid(Object comProxy)
bei NetOffice.Core.GetFactoryInfo(Object comProxy)
bei NetOffice.Core.CreateObjectFromComProxy(COMObject caller, Object comProxy)
bei NetOffice.ExcelApi.Sheets.get_Item(Object index)

Can someone help me with that problem?
Nov 27, 2014 at 8:51 AM
looks for a security issue. make sure your code is running in a local desktop session.
otherwise, give closedxml a try: