473,322 Members | 1,699 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,322 software developers and data experts.

VB.NET error

Hi,

I have a VB 6.0 code that has been migrated to VB.NET.

This code basically writes data to an Excel file.

On execution of the migrated VB.NET code, I get an error:

-------------------------------------------------------------------------------------------

An unhandled exception of type 'System.Runtime.InteropServices.COMException' occurred in mscorlib.dll



Additional information: Exception from HRESULT: 0x800A03EC.

--------------------------------------------------------------------------------------------

Please help !

- Gary

Nov 20 '05 #1
5 7164
Hi Gary,

No Help appears to be available from MSDN for that error code. Can you indicate during execution of what line did that error occur?

Regards

Narayan
"Gary" <ms****@microsoft.com> wrote in message news:eB**************@TK2MSFTNGP11.phx.gbl...
Hi,

I have a VB 6.0 code that has been migrated to VB.NET.

This code basically writes data to an Excel file.

On execution of the migrated VB.NET code, I get an error:

-------------------------------------------------------------------------------------------

An unhandled exception of type 'System.Runtime.InteropServices.COMException' occurred in mscorlib.dll



Additional information: Exception from HRESULT: 0x800A03EC.

--------------------------------------------------------------------------------------------

Please help !

- Gary

Nov 20 '05 #2
Hello,

"Gary" <ms****@microsoft.com> schrieb:
I have a VB 6.0 code that has been migrated to VB.NET.
This code basically writes data to an Excel file.
On execution of the migrated VB.NET code, I get an error:

An unhandled exception of type 'System.Runtime.InteropServices.
COMException' occurred in mscorlib.dll


Help impossible without code.

--
Herfried K. Wagner
MVP · VB Classic, VB.NET
http://www.mvps.org/dotnet
Nov 20 '05 #3
Thanks for replying.
This is the line of code that causes the error:
ExcelGlobal_definst.Selection.Subtotal(GroupBy:=3,
Function:=Excel.XlConsolidationFunction.xlSum, TotalList:=New Object() {8,
9, 10, 11, 13, 14, 16, 17, 19, 21, 22, 24, 25, 26, 27, 28},
Replace_Renamed:=True, PageBreaks:=False, SummaryBelowData:=False)

Thanks again,
Gary

"Herfried K. Wagner [MVP]" <hi*******@m.activevb.de> wrote in message
news:OE*************@tk2msftngp13.phx.gbl...
Hello,

"Gary" <ms****@microsoft.com> schrieb:
I have a VB 6.0 code that has been migrated to VB.NET.
This code basically writes data to an Excel file.
On execution of the migrated VB.NET code, I get an error:

An unhandled exception of type 'System.Runtime.InteropServices.
COMException' occurred in mscorlib.dll


Help impossible without code.

--
Herfried K. Wagner
MVP · VB Classic, VB.NET
http://www.mvps.org/dotnet

Nov 20 '05 #4
"Gary" <ms****@microsoft.com> schrieb
I have a VB 6.0 code that has been migrated to VB.NET.

This code basically writes data to an Excel file.

On execution of the migrated VB.NET code, I get an error:

-------------------------------------------------------------------------- -----------------
An unhandled exception of type
'System.Runtime.InteropServices.COMException' occurred in
mscorlib.dll

Additional information: Exception from HRESULT: 0x800A03EC.

--------------------------------------------------------------------------

------------------

How should we know an answer without knowing where the error occurs? I may
not have an answer but it would also help others to help you.
--
Armin

Nov 20 '05 #5
Hi Gary,

Firstly there appears to be no named parameter in the method called
Replace_Renamed. Try changing this to Replace: = True.

Another thing:
This appears to be macro recorded code pasted into the project. As you are
probably already aware, MS recommeds this (macro recording) only as a
learning tool. Code generated by recording a Macro is often inefficient
code. An immediate problem that I see with macro recorded code is that it
almost always produces late bound code.

Another thing is that it always uses the Global Selection Property (of the
Application Object). We generally expect it to be a Worksheet Range, but
this could well be an Embedded Chart Object, in which case methods of the
Range object that we use are bound to fail at runtime(but will compile!!).
But if you use something like Worksheet.Cells(x,y), it is less likely to
fail.

It would probably be better to write something like this:

Dim R As Excel.Range
Set R = Ws.Cells(2, 2)

R.Subtotal(3, XlConsolidationFunction.xlSum, New Int32() {3, 4, 5}, True,
False, XlSummaryRow.xlSummaryBelow)

Hope this helps

Narayan

"Gary" <ms****@microsoft.com> wrote in message
news:eV**************@TK2MSFTNGP12.phx.gbl...
Thanks for replying.
This is the line of code that causes the error:
ExcelGlobal_definst.Selection.Subtotal(GroupBy:=3,
Function:=Excel.XlConsolidationFunction.xlSum, TotalList:=New Object() {8,
9, 10, 11, 13, 14, 16, 17, 19, 21, 22, 24, 25, 26, 27, 28},
Replace_Renamed:=True, PageBreaks:=False, SummaryBelowData:=False)

Thanks again,
Gary

"Herfried K. Wagner [MVP]" <hi*******@m.activevb.de> wrote in message
news:OE*************@tk2msftngp13.phx.gbl...
Hello,

"Gary" <ms****@microsoft.com> schrieb:
I have a VB 6.0 code that has been migrated to VB.NET.
This code basically writes data to an Excel file.
On execution of the migrated VB.NET code, I get an error:

An unhandled exception of type 'System.Runtime.InteropServices.
COMException' occurred in mscorlib.dll


Help impossible without code.

--
Herfried K. Wagner
MVP · VB Classic, VB.NET
http://www.mvps.org/dotnet


Nov 20 '05 #6

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: AIM | last post by:
Error in msvc in building inheritance.obj to build hello.pyd Hello, I am trying to build the boost 1.31.0 sample extension hello.cpp. I can not compile the file inheritance.cpp because the two...
2
by: Gregory | last post by:
Hi, One of the disadvantages of using error handling with error codes instead of exception handling is that error codes retuned from a function can be forgotten to check thus leading to...
13
by: deko | last post by:
I use this convention frequently: Exit_Here: Exit Sub HandleErr: Select Case Err.Number Case 3163 Resume Next Case 3376 Resume Next
7
by: p | last post by:
WE had a Crystal 8 WebApp using vs 2002 which we upgraded to VS2003. I also have Crystal 9 pro on my development machine. The web app runs fine on my dev machine but am having problems deploying....
3
by: Manuel | last post by:
I'm trying to compile glut 3.7.6 (dowbloaded from official site)using devc++. So I've imported the glut32.dsp into devc++, included manually some headers, and start to compile. It return a very...
2
by: f rom | last post by:
----- Forwarded Message ---- From: Josiah Carlson <jcarlson@uci.edu> To: f rom <etaoinbe@yahoo.com>; wxpython-users@lists.wxwidgets.org Sent: Monday, December 4, 2006 10:03:28 PM Subject: Re: ...
2
hyperpau
by: hyperpau | last post by:
Before anything else, I am not a very technical expert when it comes to VBA coding. I learned most of what I know by the excellent Access/VBA forum from bytes.com (formerly thescripts.com). Ergo, I...
0
hyperpau
by: hyperpau | last post by:
Before anything else, I am not a very technical expert when it comes to VBA coding. I learned most of what I know by the excellent Access/VBA forum from bytes.com (formerly thescripts.com). Ergo, I...
5
by: yashu0209 | last post by:
I have an error occurring when i try to compile the program and the error is: D:\Program Files\visual studio 6.0\MSDev98\MyProjects\GLEnabledView\GLNew.cpp(164) : error C2653: 'CGLEnabledView' :...
2
by: randa zaghdan | last post by:
Hi I have a problem with my program in vc 2008 When I compile it, the following errors are listed. I try to resolve it but no hope Does any one can help me ? thanks . Linking......
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.