473,508 Members | 2,370 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

HRESULT error when inserting a formula

hello!

i am using visual studio 2000 and am trying to insert a formúla into
an excel cell. the code goes like this:

with excel
.workbooks.open (datei(i))
.activesheet.name ="statistik 2004"
.activesheet.range("b7").select()
.selection.insert()
.range("b7").formular1c1 = "=rc[-1]*1"
end with

excel is defined as excel.application

i have problems with the formular1c1 command. i think the syntax is
ok, but when i am executing the application visual basic shows me a
messagebox with

"An unhandled exeption of type
'system.runtime.interopservices.comexception' occured in mscorlib.dll.
Additional information: Exception from HRESULT: 0x800A03EC"

can anyone help me?

adrian


--------------------------------------------------------------------------------
Nov 20 '05 #1
4 5662
* ak*******@arcor.de (adrian) scripsit:
i am using visual studio 2000 and am trying to insert a formúla into


What's VS 2000?!

--
Herfried K. Wagner [MVP]
<URL:http://dotnet.mvps.org/>
Nov 20 '05 #2
From some old VB6 code I have lying around...

Set xlApp = New Excel.Application
' base workbook on template that contains some predefined macros...
Set xlBook = xlApp.Workbooks.Add(gsNetPath & "\mytemplate.xlt")

Dim xlSheet As Excel.Worksheet
Set xlSheet = xlBook.Worksheets.Add

xlSheet.Range("B7").Value = "=RC[-1]*1"

Looks like I was using Value property when I needed to add a formula...

untested

HTH,
Greg

"adrian" <ak*******@arcor.de> wrote in message
news:6a**************************@posting.google.c om...
hello!

i am using visual studio 2000 and am trying to insert a formúla into
an excel cell. the code goes like this:

with excel
.workbooks.open (datei(i))
.activesheet.name ="statistik 2004"
.activesheet.range("b7").select()
.selection.insert()
.range("b7").formular1c1 = "=rc[-1]*1"
end with

excel is defined as excel.application

i have problems with the formular1c1 command. i think the syntax is
ok, but when i am executing the application visual basic shows me a
messagebox with

"An unhandled exeption of type
'system.runtime.interopservices.comexception' occured in mscorlib.dll.
Additional information: Exception from HRESULT: 0x800A03EC"

can anyone help me?

adrian


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

------
Nov 20 '05 #3
hello!

since i am still not able to solve the problem here's more code. hope
it will help...

public class form1
inherite system.windows.forms.form
dim excel as excel.application
dim exlsheet as excel.worksheet
dim exlbook as excel.workbook
dim beginn, ende as integer
dim datei(53) as string
dim i as integer

private sub button1_click(...)
datei(1)= "...."
datei(2)= "...."
....

beginn = beginn_eingabe.text
ende = ende_eingabe.text
excel = createobject ("excel.application"
excel.visible = true
i = beginn
do
exlbook = excel.workbooks.open (datei(i))
exlsheet = exlbook.activesheet
with exlsheet
.name = "..."
.columns ("B:B").Insert()
.range ("b7").formular1c1 = "=RC[-1]*1"
.....

the application is interupting at the last command (formular1c1). i
don't know whats the problem. please help me!!!!

thanks in advance

adrian
p.s. i am using microsoft visual studio 2002 and excel xp

ak*******@arcor.de (adrian) wrote in message news:<6a**************************@posting.google. com>...
hello!

i am using visual studio 2000 and am trying to insert a formúla into
an excel cell. the code goes like this:

with excel
.workbooks.open (datei(i))
.activesheet.name ="statistik 2004"
.activesheet.range("b7").select()
.selection.insert()
.range("b7").formular1c1 = "=rc[-1]*1"
end with

excel is defined as excel.application

i have problems with the formular1c1 command. i think the syntax is
ok, but when i am executing the application visual basic shows me a
messagebox with

"An unhandled exeption of type
'system.runtime.interopservices.comexception' occured in mscorlib.dll.
Additional information: Exception from HRESULT: 0x800A03EC"

can anyone help me?

adrian


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

Nov 20 '05 #4
neither the command "formular1c1" nor "value" is working.

ak*******@arcor.de (adrian) wrote in message news:<6a**************************@posting.google. com>...
hello!

i am using visual studio 2000 and am trying to insert a formúla into
an excel cell. the code goes like this:

with excel
.workbooks.open (datei(i))
.activesheet.name ="statistik 2004"
.activesheet.range("b7").select()
.selection.insert()
.range("b7").formular1c1 = "=rc[-1]*1"
end with

excel is defined as excel.application

i have problems with the formular1c1 command. i think the syntax is
ok, but when i am executing the application visual basic shows me a
messagebox with

"An unhandled exeption of type
'system.runtime.interopservices.comexception' occured in mscorlib.dll.
Additional information: Exception from HRESULT: 0x800A03EC"

can anyone help me?

adrian


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

Nov 20 '05 #5

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

Similar topics

1
6307
by: Kimmo Laine | last post by:
Hi, we have a (unmanaged) ATL COM server, which implements two interface: ITestInterface1 and ITestInterface2. Both of these interfaces also support the ISupportErrorInfo-interface. Interface...
4
5306
by: KC | last post by:
Is this Exception from HRESULT: 0x800401A8 an error or a bug? I've been trying to build a chart in Excel through VB.net (which isn't documented) so I'm running completely blind. What examples...
18
22372
by: robert | last post by:
Is there a ready made function in numpy/scipy to compute the correlation y=mx+o of an X and Y fast: m, m-err, o, o-err, r-coef,r-coef-err ? Or a formula to to compute the 3 error ranges? ...
4
10858
by: cpajoe2001 | last post by:
I am not sure if this is the proper place to put this thread but I have run into a road block. I am writing a web app that will create groups in Active Directory then add users to those groups. I...
1
2610
by: madhuxml82 | last post by:
Dear Forum Members, I have generated an XML Schema and a Table of XMLType referencing the XML Schema. Now When I am Inserting the Data into the Table. I am getting the Error 0RA-30937: Error is...
6
3226
by: =?Utf-8?B?Um9i?= | last post by:
Hi, If I call my own DLL from Javascript, a HRESULT is returned. Javascript cannot cast this to an integer. Is there any other way of typecasting this returnvalue to integer, wihout using the...
0
1802
by: hne | last post by:
Hi friends, I have an application, written in C#, in which I am updating an Excel spreadsheet with data I pull from a sql database. When I try to select a cell in where I want to begin inserting my...
3
15908
by: wundertier | last post by:
Hi, I'm accessing COM objects from C#.net. In case of error a COMException is thrown which includes the HRESULT. But how do I get the description for the HRESULT? The Message property of the...
11
5917
by: Academia | last post by:
I've been Googling and there is many many hits but I can't find what I want. I've read at one time how DotNET treats HRESULT but can't find it now. Does it return HRESULT unchanged or does it...
0
7118
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...
0
7379
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...
0
7493
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
5625
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,...
1
5049
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...
0
3192
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
3180
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
1550
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
0
415
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...

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.