473,832 Members | 2,126 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.na me ="statistik 2004"
.activesheet.ra nge("b7").selec t()
.selection.inse rt()
.range("b7").fo rmular1c1 = "=rc[-1]*1"
end with

excel is defined as excel.applicati on

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 .interopservice s.comexception' occured in mscorlib.dll.
Additional information: Exception from HRESULT: 0x800A03EC"

can anyone help me?

adrian


--------------------------------------------------------------------------------
Nov 20 '05 #1
4 5684
* 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.Applicati on
' base workbook on template that contains some predefined macros...
Set xlBook = xlApp.Workbooks .Add(gsNetPath & "\mytemplate.xl t")

Dim xlSheet As Excel.Worksheet
Set xlSheet = xlBook.Workshee ts.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*******@arco r.de> wrote in message
news:6a******** *************** ***@posting.goo gle.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.na me ="statistik 2004"
.activesheet.ra nge("b7").selec t()
.selection.inse rt()
.range("b7").fo rmular1c1 = "=rc[-1]*1"
end with

excel is defined as excel.applicati on

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 .interopservice s.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.applicati on
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.te xt
excel = createobject ("excel.applica tion"
excel.visible = true
i = beginn
do
exlbook = excel.workbooks .open (datei(i))
exlsheet = exlbook.actives heet
with exlsheet
.name = "..."
.columns ("B:B").Insert( )
.range ("b7").formular 1c1 = "=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.go ogle.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.na me ="statistik 2004"
.activesheet.ra nge("b7").selec t()
.selection.inse rt()
.range("b7").fo rmular1c1 = "=rc[-1]*1"
end with

excel is defined as excel.applicati on

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 .interopservice s.comexception' occured in mscorlib.dll.
Additional information: Exception from HRESULT: 0x800A03EC"

can anyone help me?

adrian


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

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

ak*******@arcor .de (adrian) wrote in message news:<6a******* *************** ****@posting.go ogle.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.na me ="statistik 2004"
.activesheet.ra nge("b7").selec t()
.selection.inse rt()
.range("b7").fo rmular1c1 = "=rc[-1]*1"
end with

excel is defined as excel.applicati on

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 .interopservice s.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
6345
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 implementation is divided into two class: CTestInterface2, which implements the ITestInterfac2, and CTestInterface1, which implements ITestInterface1 AND ITestInterface2.
4
5324
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 I have found are from VB6 which doesn't convert well. When I do try a new piece of code like: oChart.Legend.Position = Excel.XlLegendPosition.xlLegendPositionBottom
18
22416
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? -robert PS: numpy.corrcoef computes only the bare coeff:
4
10932
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 have it creating the groups just fine however when i go to add a user i get. The requested operation did not satisfy one or more constraints associated with the class of the object. (Exception from HRESULT: 0x80072014) And I can not find any help on...
1
2632
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 Comming. I am pasting the Code which I have written. Appreciate any Help... begin dbms_xmlschema.registerSchema( 'http://www.robertboschindia.com/example.xsd',
6
3254
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 exception method which is described everywhere ? Please note that I am unfamiliar with javascript, I am used to C/C++. My Javascript call looks like : var result;
0
1820
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 data I get the error -- Exception from HRESULT: 0x800A03EC (what does this mean?). I've searched the web and have been unsuccessful in finding a viable solution to the error. A snippet of my code is below: Excel.Range cf = null; // Create...
3
15936
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 COMException does not contain any useful information. Example (I've got a german OS only, so I don't know the exact english version of these texts): HRESULT is: 800706ba
11
5944
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 check it for error-return or what? Thanks for any help
0
9642
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
10499
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...
0
10212
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
9320
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
7753
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
6951
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5789
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4421
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 we have to send another system
3
3078
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.