Win32Exception (0x80004005): Class already exists
Page 1 of 1

Author:  newtoncd [ Sun Apr 27, 2008 5:02 pm ]
Post subject:  Win32Exception (0x80004005): Class already exists


I'm evaluating the EasyXLS and sometimes the following error occurs:

Line 75: Dim xls As New ExcelDocument
Line 76: Dim xlsWorksheet As New ExcelWorksheet("CLIENTES")
Line 77: xls.easy_addWorksheet(xlsWorksheet)

Source File: C:\sites\NetStoreManager2007\web\IEclientes.aspx.vb Line: 76

Stack Trace:

[Win32Exception (0x80004005): Class already exists]
System.Windows.Forms.WindowClass.RegisterClass() +1091
System.Windows.Forms.WindowClass.Create(String className, Int32 classStyle) +181
System.Windows.Forms.NativeWindow.CreateHandle(CreateParams cp) +215
System.Windows.Forms.Control.CreateHandle() +213
System.Windows.Forms.Control.get_Handle() +60
System.Windows.Forms.Control.CreateHandle() +200
System.Windows.Forms.Control.get_Handle() +60
System.Windows.Forms.Control.CreateGraphicsInternal() +5
System.Windows.Forms.Control.CreateGraphics() +36
EasyXLS.Util.Conversion.b..cctor() +202

[TypeInitializationException: The type initializer for "EasyXLS.Util.Conversion.b" threw an exception.]
EasyXLS.Util.Conversion.b.a(Int32 A_0, Int16[] A_1, String A_2, Boolean A_3) +20
EasyXLS.ExcelSheet.setSheetName(String sheetName) +602
EasyXLS.ExcelSheet..ctor() +136
EasyXLS.ExcelWorksheet..ctor(String sheetName) +46
IEclientes.exportarBtn_Click(Object sender, EventArgs e) in C:\sites\NetStoreManager2007\web\IEclientes.aspx.vb:76
System.Web.UI.WebControls.Button.OnClick(EventArgs e) +108
PeterBlum.VAM.Button.OnClick(EventArgs pE) +71
System.Web.UI.WebControls.Button.System.Web.UI.IPostBackEventHandler.RaisePostBackEvent(String eventArgument) +57
System.Web.UI.Page.RaisePostBackEvent(IPostBackEventHandler sourceControl, String eventArgument) +18
System.Web.UI.Page.RaisePostBackEvent(NameValueCollection postData) +33
System.Web.UI.Page.ProcessRequestMain() +1292

The vb source is:

Private Sub exportarBtn_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles exportarBtn.Click

Dim xls As New ExcelDocument

Dim xlsWorksheet As New ExcelWorksheet("CLIENTES")


xlsWorksheet.easy_insertDataSet(GetClientesDataset, 0, 0, True)

Catch exc As Exception
   exportMsg.Text = exc.Message
End Try


End Sub

What I am doing wrong?


Author:  daniela [ Tue May 06, 2008 3:16 am ]
Post subject: 

This is a .Net Framework defect. It is a recognized Microsoft bug and it occurs because a form may not be correctly disposed. It usually happens for a web application and only in the Visual Studio .NET development environment. Restarting IIS solves the problem. Please install the latest patch for .NET Framework. This may fix your problem.

Page 1 of 1 All times are UTC - 4 hours
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group