473,781 Members | 2,335 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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 .InteropService s.COMException' occurred in mscorlib.dll



Additional information: Exception from HRESULT: 0x800A03EC.

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

Please help !

- Gary

Nov 20 '05 #1
5 7222
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****@microso ft.com> wrote in message news:eB******** ******@TK2MSFTN GP11.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 .InteropService s.COMException' occurred in mscorlib.dll



Additional information: Exception from HRESULT: 0x800A03EC.

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

Please help !

- Gary

Nov 20 '05 #2
Hello,

"Gary" <ms****@microso ft.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 .InteropService s.
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_def inst.Selection. Subtotal(GroupB y:=3,
Function:=Excel .XlConsolidatio nFunction.xlSum , TotalList:=New Object() {8,
9, 10, 11, 13, 14, 16, 17, 19, 21, 22, 24, 25, 26, 27, 28},
Replace_Renamed :=True, PageBreaks:=Fal se, SummaryBelowDat a:=False)

Thanks again,
Gary

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

"Gary" <ms****@microso ft.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 .InteropService s.
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****@microso ft.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 .InteropService s.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, XlConsolidation Function.xlSum, New Int32() {3, 4, 5}, True,
False, XlSummaryRow.xl SummaryBelow)

Hope this helps

Narayan

"Gary" <ms****@microso ft.com> wrote in message
news:eV******** ******@TK2MSFTN GP12.phx.gbl...
Thanks for replying.
This is the line of code that causes the error:
ExcelGlobal_def inst.Selection. Subtotal(GroupB y:=3,
Function:=Excel .XlConsolidatio nFunction.xlSum , TotalList:=New Object() {8,
9, 10, 11, 13, 14, 16, 17, 19, 21, 22, 24, 25, 26, 27, 28},
Replace_Renamed :=True, PageBreaks:=Fal se, SummaryBelowDat a:=False)

Thanks again,
Gary

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

"Gary" <ms****@microso ft.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 .InteropService s.
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
4381
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 files containing some templates: adjacency_list.hpp and mem_fn.hpp can not compile. Does anyone have any solutions?
2
2977
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 unexpected run-time problems. Exceptions on the other hand can not be simply ignored. In order to solve this error codes problem I suggest using error object instead of error codes. Each function has to return an error object that stores an error
13
6616
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
5025
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. I created the websetup and built the MSI, have the bundled version. Copied to webserver and ran Websetup.msi. Said I had to remove old version, which I did, then reran WebSetup.msi and keeps giving me this error. "The installer was interrupted...
3
16252
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 strange error. In your experience, where I should looking to find the real error? Surely the sintax of glut is correct... gcc.exe -c glut_bitmap.c -o glut_bitmap.o -I"C:/Dev-Cpp/include" -I"../../include" -D__GNUWIN32__ -W -DWIN32 -DNDEBUG...
2
5332
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: 1>make_buildinfo.obj : error LNK2019: unresolved external symbol __imp__RegQueryValueExA@24 referenced in function _make_buildinfo2 Ask on python-list@python.org . - Josiah
2
19492
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 will be writing this article intended for those who are in the same level, or maybe lower, of my technical knowledge. I would be using layman's words, or maybe, my own words as how I understand them, hoping, you will understand it the same way that...
0
2897
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 will be writing this article intended for those who are in the same level, or maybe lower, of my technical knowledge. I would be using layman's words, or maybe, my own words as how I understand them, hoping, you will understand it the same way that...
5
4165
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' : is not a class or namespace name D:\Program Files\visual studio 6.0\MSDev98\MyProjects\GLEnabledView\GLNew.cpp(164) : error C2061: syntax error : identifier 'CGLEnabledView' D:\Program Files\visual studio...
2
3246
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... 1>tdrawAa.obj : error LNK2005: _main already defined in tclose.obj
0
9636
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9474
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10306
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10139
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10075
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8961
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7485
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 presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5504
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
3
2869
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.