473,405 Members | 2,404 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,405 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 7186
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: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 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 a new...

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.