473,657 Members | 2,499 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Exception from HRESULT: 0x800A03EC

Additional information: Exception from HRESULT: 0x800A03EC.

This code produced this error. I am pretty sure I got this to run a while
back and I was wondering if you all see anything I am doing wrong.....or do
you have a suggestion for a better way.......I do know this method is quite
slow.
Private Sub Button2_Click(B yVal sender As System.Object, ByVal e As
System.EventArg s) Handles Button2.Click
Dim WSheet As New Excel.Worksheet
Dim colindex As Integer
Dim Excel As New Excel.Applicati on
Dim rowindex As Integer
Try
OleDbDataAdapte r1.Fill(DataSet 11.ITEMS)
Catch ex As Exception
MessageBox.Show (ex.ToString())
End Try

With WSheet
Dim col As DataColumn
colindex = 1
Dim rowon As Integer = 1
For Each col In DataSet11.Table s(0).Columns
'colindex += 1
Excel.Cells(row on, colindex) = col.ColumnName. ToString
colindex = colindex + 1
Next col
Dim row As DataRow
colindex = 1
rowindex = 2
For Each row In DataSet11.Table s(0).Rows

For Each col In DataSet11.Table s(0).Columns
'colindex += 1
.Cells(rowindex , colindex).Value =
row(col.ColumnN ame).ToString()
rowindex = rowindex + 1
colindex = colindex + 1
Next col
Next row
Try
'Saving .xls file with Test.xls name
WSheet.SaveAs(" C:\TEST.XLS")
Catch
End Try
'setting up caption that "File Created"
Me.Text = "File Created"
'closing down workbook
EXL.Workbooks.C lose()
End With

End Sub
Nov 20 '05 #1
8 14496
I figured it out on the cell by cell approach.

If anyone could show me an example using this code how I could have used an
array to do this I would love to see it.....Thank You...

"scorpion53 061" <sc************ @yahoo.com> wrote in message
news:uK******** ******@tk2msftn gp13.phx.gbl...
Additional information: Exception from HRESULT: 0x800A03EC.

This code produced this error. I am pretty sure I got this to run a while
back and I was wondering if you all see anything I am doing wrong.....or do you have a suggestion for a better way.......I do know this method is quite slow.
Private Sub Button2_Click(B yVal sender As System.Object, ByVal e As
System.EventArg s) Handles Button2.Click
Dim WSheet As New Excel.Worksheet
Dim colindex As Integer
Dim Excel As New Excel.Applicati on
Dim rowindex As Integer
Try
OleDbDataAdapte r1.Fill(DataSet 11.ITEMS)
Catch ex As Exception
MessageBox.Show (ex.ToString())
End Try

With WSheet
Dim col As DataColumn
colindex = 1
Dim rowon As Integer = 1
For Each col In DataSet11.Table s(0).Columns
'colindex += 1
Excel.Cells(row on, colindex) = col.ColumnName. ToString
colindex = colindex + 1
Next col
Dim row As DataRow
colindex = 1
rowindex = 2
For Each row In DataSet11.Table s(0).Rows

For Each col In DataSet11.Table s(0).Columns
'colindex += 1
.Cells(rowindex , colindex).Value =
row(col.ColumnN ame).ToString()
rowindex = rowindex + 1
colindex = colindex + 1
Next col
Next row
Try
'Saving .xls file with Test.xls name
WSheet.SaveAs(" C:\TEST.XLS")
Catch
End Try
'setting up caption that "File Created"
Me.Text = "File Created"
'closing down workbook
EXL.Workbooks.C lose()
End With

End Sub

Nov 20 '05 #2
Cor
Hi Scorpion,
I have put that what I promished yesterday in that mailstring.
Cor
Nov 20 '05 #3
This was the corrected code......if anyone could show me how to do this with
an Array in this code I would be greatful.....

Private Sub Button2_Click(B yVal sender As System.Object, ByVal e As
System.EventArg s) Handles Button2.Click
Dim WSheet As New Excel.Worksheet
Dim colindex As Integer
Dim Excel As New Excel.Applicati on
Dim rowindex As Integer

Try
OleDbDataAdapte r1.Fill(DataSet 11.ITEMS)
Catch ex As Exception
MessageBox.Show (ex.ToString())
End Try
Excel.Visible = True
WSheet = Excel.Workbooks .Add.Worksheets .Add
With WSheet
Dim col As DataColumn
Dim i, r, c As Integer
For i = 0 To DataSet11.Table s.Count - 1
colindex = 1
Dim rowon As Integer = 1
For c = 0 To DataSet11.Table s(i).Columns.Co unt - 1
Excel.Cells(row on, colindex).Value =
DataSet11.Table s(i).Columns(c) .ColumnName
colindex = colindex + 1
Next
colindex = 1
rowon = 2
For r = 0 To DataSet11.Table s(i).Rows.Count - 1
For c = 0 To DataSet11.Table s(i).Columns.Co unt - 1
Excel.Cells(row on, colindex).Value =
DataSet11.Table s(i).Rows(r).It em(c)
colindex = colindex + 1
Next
rowon = rowon + 1
colindex = 1
Next

Next
Try
'Saving .xls file with Test.xls name
WSheet.SaveAs(" C:\TEST.XLS")
Catch
End Try
'setting up caption that "File Created"
Me.Text = "File Created"
'closing down workbook
EXL.Workbooks.C lose()
End With

End Sub
"scorpion53 061" <sc************ @yahoo.com> wrote in message
news:uR******** ******@tk2msftn gp13.phx.gbl...
I figured it out on the cell by cell approach.

If anyone could show me an example using this code how I could have used an array to do this I would love to see it.....Thank You...

"scorpion53 061" <sc************ @yahoo.com> wrote in message
news:uK******** ******@tk2msftn gp13.phx.gbl...
Additional information: Exception from HRESULT: 0x800A03EC.

This code produced this error. I am pretty sure I got this to run a while back and I was wondering if you all see anything I am doing wrong.....or

do
you have a suggestion for a better way.......I do know this method is

quite
slow.
Private Sub Button2_Click(B yVal sender As System.Object, ByVal e As
System.EventArg s) Handles Button2.Click
Dim WSheet As New Excel.Worksheet
Dim colindex As Integer
Dim Excel As New Excel.Applicati on
Dim rowindex As Integer
Try
OleDbDataAdapte r1.Fill(DataSet 11.ITEMS)
Catch ex As Exception
MessageBox.Show (ex.ToString())
End Try

With WSheet
Dim col As DataColumn
colindex = 1
Dim rowon As Integer = 1
For Each col In DataSet11.Table s(0).Columns
'colindex += 1
Excel.Cells(row on, colindex) = col.ColumnName. ToString
colindex = colindex + 1
Next col
Dim row As DataRow
colindex = 1
rowindex = 2
For Each row In DataSet11.Table s(0).Rows

For Each col In DataSet11.Table s(0).Columns
'colindex += 1
.Cells(rowindex , colindex).Value =
row(col.ColumnN ame).ToString()
rowindex = rowindex + 1
colindex = colindex + 1
Next col
Next row
Try
'Saving .xls file with Test.xls name
WSheet.SaveAs(" C:\TEST.XLS")
Catch
End Try
'setting up caption that "File Created"
Me.Text = "File Created"
'closing down workbook
EXL.Workbooks.C lose()
End With

End Sub


Nov 20 '05 #4
A 32,000 row spreadsheet using this method (14 columns) took almost 45
minutes.

If anyone has ideas on how to improve this situation I would be greatful.

"scorpion53 061" <sc************ @yahoo.com> wrote in message
news:ed******** ******@TK2MSFTN GP09.phx.gbl...
This was the corrected code......if anyone could show me how to do this with an Array in this code I would be greatful.....

Private Sub Button2_Click(B yVal sender As System.Object, ByVal e As
System.EventArg s) Handles Button2.Click
Dim WSheet As New Excel.Worksheet
Dim colindex As Integer
Dim Excel As New Excel.Applicati on
Dim rowindex As Integer

Try
OleDbDataAdapte r1.Fill(DataSet 11.ITEMS)
Catch ex As Exception
MessageBox.Show (ex.ToString())
End Try
Excel.Visible = True
WSheet = Excel.Workbooks .Add.Worksheets .Add
With WSheet
Dim col As DataColumn
Dim i, r, c As Integer
For i = 0 To DataSet11.Table s.Count - 1
colindex = 1
Dim rowon As Integer = 1
For c = 0 To DataSet11.Table s(i).Columns.Co unt - 1
Excel.Cells(row on, colindex).Value =
DataSet11.Table s(i).Columns(c) .ColumnName
colindex = colindex + 1
Next
colindex = 1
rowon = 2
For r = 0 To DataSet11.Table s(i).Rows.Count - 1
For c = 0 To DataSet11.Table s(i).Columns.Co unt - 1
Excel.Cells(row on, colindex).Value =
DataSet11.Table s(i).Rows(r).It em(c)
colindex = colindex + 1
Next
rowon = rowon + 1
colindex = 1
Next

Next
Try
'Saving .xls file with Test.xls name
WSheet.SaveAs(" C:\TEST.XLS")
Catch
End Try
'setting up caption that "File Created"
Me.Text = "File Created"
'closing down workbook
EXL.Workbooks.C lose()
End With

End Sub
"scorpion53 061" <sc************ @yahoo.com> wrote in message
news:uR******** ******@tk2msftn gp13.phx.gbl...
I figured it out on the cell by cell approach.

If anyone could show me an example using this code how I could have used

an
array to do this I would love to see it.....Thank You...

"scorpion53 061" <sc************ @yahoo.com> wrote in message
news:uK******** ******@tk2msftn gp13.phx.gbl...
Additional information: Exception from HRESULT: 0x800A03EC.

This code produced this error. I am pretty sure I got this to run a while back and I was wondering if you all see anything I am doing
wrong.....or do
you have a suggestion for a better way.......I do know this method is

quite
slow.
Private Sub Button2_Click(B yVal sender As System.Object, ByVal e As
System.EventArg s) Handles Button2.Click
Dim WSheet As New Excel.Worksheet
Dim colindex As Integer
Dim Excel As New Excel.Applicati on
Dim rowindex As Integer
Try
OleDbDataAdapte r1.Fill(DataSet 11.ITEMS)
Catch ex As Exception
MessageBox.Show (ex.ToString())
End Try

With WSheet
Dim col As DataColumn
colindex = 1
Dim rowon As Integer = 1
For Each col In DataSet11.Table s(0).Columns
'colindex += 1
Excel.Cells(row on, colindex) = col.ColumnName. ToString
colindex = colindex + 1
Next col
Dim row As DataRow
colindex = 1
rowindex = 2
For Each row In DataSet11.Table s(0).Rows

For Each col In DataSet11.Table s(0).Columns
'colindex += 1
.Cells(rowindex , colindex).Value =
row(col.ColumnN ame).ToString()
rowindex = rowindex + 1
colindex = colindex + 1
Next col
Next row
Try
'Saving .xls file with Test.xls name
WSheet.SaveAs(" C:\TEST.XLS")
Catch
End Try
'setting up caption that "File Created"
Me.Text = "File Created"
'closing down workbook
EXL.Workbooks.C lose()
End With

End Sub



Nov 20 '05 #5
Problem Solved......
"scorpion53 061" <sc************ @yahoo.com> wrote in message
news:OM******** ********@TK2MSF TNGP10.phx.gbl. ..
A 32,000 row spreadsheet using this method (14 columns) took almost 45
minutes.

If anyone has ideas on how to improve this situation I would be greatful.

"scorpion53 061" <sc************ @yahoo.com> wrote in message
news:ed******** ******@TK2MSFTN GP09.phx.gbl...
This was the corrected code......if anyone could show me how to do this

with
an Array in this code I would be greatful.....

Private Sub Button2_Click(B yVal sender As System.Object, ByVal e As
System.EventArg s) Handles Button2.Click
Dim WSheet As New Excel.Worksheet
Dim colindex As Integer
Dim Excel As New Excel.Applicati on
Dim rowindex As Integer

Try
OleDbDataAdapte r1.Fill(DataSet 11.ITEMS)
Catch ex As Exception
MessageBox.Show (ex.ToString())
End Try
Excel.Visible = True
WSheet = Excel.Workbooks .Add.Worksheets .Add
With WSheet
Dim col As DataColumn
Dim i, r, c As Integer
For i = 0 To DataSet11.Table s.Count - 1
colindex = 1
Dim rowon As Integer = 1
For c = 0 To DataSet11.Table s(i).Columns.Co unt - 1
Excel.Cells(row on, colindex).Value =
DataSet11.Table s(i).Columns(c) .ColumnName
colindex = colindex + 1
Next
colindex = 1
rowon = 2
For r = 0 To DataSet11.Table s(i).Rows.Count - 1
For c = 0 To DataSet11.Table s(i).Columns.Co unt - 1
Excel.Cells(row on, colindex).Value =
DataSet11.Table s(i).Rows(r).It em(c)
colindex = colindex + 1
Next
rowon = rowon + 1
colindex = 1
Next

Next
Try
'Saving .xls file with Test.xls name
WSheet.SaveAs(" C:\TEST.XLS")
Catch
End Try
'setting up caption that "File Created"
Me.Text = "File Created"
'closing down workbook
EXL.Workbooks.C lose()
End With

End Sub
"scorpion53 061" <sc************ @yahoo.com> wrote in message
news:uR******** ******@tk2msftn gp13.phx.gbl...
I figured it out on the cell by cell approach.

If anyone could show me an example using this code how I could have used
an
array to do this I would love to see it.....Thank You...

"scorpion53 061" <sc************ @yahoo.com> wrote in message
news:uK******** ******@tk2msftn gp13.phx.gbl...
> Additional information: Exception from HRESULT: 0x800A03EC.
>
> This code produced this error. I am pretty sure I got this to run a

while
> back and I was wondering if you all see anything I am doing wrong.....or do
> you have a suggestion for a better way.......I do know this method

is quite
> slow.
>
>
> Private Sub Button2_Click(B yVal sender As System.Object, ByVal e As
> System.EventArg s) Handles Button2.Click
> Dim WSheet As New Excel.Worksheet
> Dim colindex As Integer
> Dim Excel As New Excel.Applicati on
> Dim rowindex As Integer
> Try
> OleDbDataAdapte r1.Fill(DataSet 11.ITEMS)
> Catch ex As Exception
> MessageBox.Show (ex.ToString())
> End Try
>
> With WSheet
> Dim col As DataColumn
> colindex = 1
> Dim rowon As Integer = 1
> For Each col In DataSet11.Table s(0).Columns
> 'colindex += 1
> Excel.Cells(row on, colindex) = col.ColumnName. ToString > colindex = colindex + 1
> Next col
> Dim row As DataRow
> colindex = 1
> rowindex = 2
> For Each row In DataSet11.Table s(0).Rows
>
> For Each col In DataSet11.Table s(0).Columns
> 'colindex += 1
> .Cells(rowindex , colindex).Value =
> row(col.ColumnN ame).ToString()
> rowindex = rowindex + 1
> colindex = colindex + 1
> Next col
> Next row
> Try
> 'Saving .xls file with Test.xls name
> WSheet.SaveAs(" C:\TEST.XLS")
> Catch
> End Try
> 'setting up caption that "File Created"
> Me.Text = "File Created"
> 'closing down workbook
> EXL.Workbooks.C lose()
> End With
>
> End Sub
>
>



Nov 20 '05 #6
* "scorpion53 061" <sc************ @yahoo.com> scripsit:
Problem Solved......


How did you solve it?

--
Herfried K. Wagner
MVP · VB Classic, VB.NET
<http://www.mvps.org/dotnet>
Nov 20 '05 #7
Sorry,

I am more familiar with ArrayLists than plain old arrays (I have only been
exposed to .NET stuff - kind of a newbie at this stuff and in situaitons
like this you work with what you know - at least kind of)

I wrote each column to an ArrayList and then wrote each arraylist to the
spreadsheet with a loop.

Only problem is I am having problems doing formatting of the data but the
boss can live without this.

"Herfried K. Wagner [MVP]" <hi************ ***@gmx.at> wrote in message
news:uL******** ********@TK2MSF TNGP09.phx.gbl. ..
* "scorpion53 061" <sc************ @yahoo.com> scripsit:
Problem Solved......


How did you solve it?

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

Nov 20 '05 #8
cut the 45 minutes down to under 10 seconds this way......

"scorpion53 061" <sc************ @yahoo.com> wrote in message
news:%2******** **********@TK2M SFTNGP10.phx.gb l...
Sorry,

I am more familiar with ArrayLists than plain old arrays (I have only been
exposed to .NET stuff - kind of a newbie at this stuff and in situaitons
like this you work with what you know - at least kind of)

I wrote each column to an ArrayList and then wrote each arraylist to the
spreadsheet with a loop.

Only problem is I am having problems doing formatting of the data but the
boss can live without this.

"Herfried K. Wagner [MVP]" <hi************ ***@gmx.at> wrote in message
news:uL******** ********@TK2MSF TNGP09.phx.gbl. ..
* "scorpion53 061" <sc************ @yahoo.com> scripsit:
Problem Solved......


How did you solve it?

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


Nov 20 '05 #9

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

Similar topics

1
11234
by: Steven | last post by:
Hi there, I am trying to export a chart using the Excel11 object from C#. I can properly open workbooks and read cells, but calling Export() on the Chart object throws a COMException Exception: System.Runtime.InteropServices.COMException (0x800A03EC): Exception from HRESULT: 0x800A03EC. at Excel._Chart.Export(String Filename, Object FilterName, Object Interactive)
3
7847
by: Lekyan | last post by:
I have problem setting the password for an ADAM user using C#. I used the SetPassword code given in the Microsoft page, changed several parameters, but ran into an exception. I wonder if other people have solved this problem. But I have searched Google groups for a couple days but still couldn't get a solution. I copied the code from: ...
0
4162
by: e-lores | last post by:
I need to print an excel doc to PDF. I'm doing next until now 1.- First I print the file to PostScript format using 'Acrobat Distiller' printer Dim wbook As Excel.Workbook wbook = appExcel.Workbooks.Open(fileExcel) wbook.PrintOut(fisrtPage, lastPage, , , "Acrobat Distiller", True, filePs) wbook.Close()
2
36967
by: Sai | last post by:
Hi, I have written a small tool for our internal purpose in VB.net. This tool reads data from logs and saves it in an excel file. This tool is working fine with MS Office 2000 but raising the following exception, when i run the tool in a machine which contains MS Office 2003. Exception raised: "Exception from HRESULT: 0x800A03EC" Note: Added "Microsoft Excel 11.0 Object Library" in the project reference.
2
17348
by: sgr | last post by:
Hello I'm making an application that uses an excel worksheet, My problem appears when I open the worksheet to see the data (then I close it and save the changes) and I try to insert a new row from my application appears the error: System.Runtime.InteropServices.COMException(0x800401A8): Exception HRESULT: 0x800401A8 Thanks for all
0
4919
by: rGh | last post by:
Hello, I am trying to create an Excel chart from C#. I am not a very experieced programmer, so my mistake could be very trivial. The code included is a very simple example. I just wanted to make sure the code runs first before I implement it into my application. The code is supposed to plot for X values: column A in excel and for Y values: column B in Excel. The code up to the point and including exporting the data to excel runs...
0
1811
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...
0
1214
by: Stephen Plotnick | last post by:
I'm getting HRESULT: 0x800A03EC On this statement: cfDataBar = osheet.Range(RangeText).FormatConditions.AddDatabar with these values in RangeText: B14,D14,F14,H14,J14,L14,N14,P14,R14,T14,V14,X14,Z14,AB14,AD14,AF14,AH14,AJ14,AL14,AN14,AP14,AR14,AT14,AV14,AX14,AZ14,BB14,BD14,BF14,BH14,BJ14,BL14,BN14,BP14,BR14,BT14,BV14,BX14,BZ14,CB14,CD14,CF14,CH14,CJ14,CL14,CN14,CP14,CR14,CT14,CV14,CX14,CZ14,DB14,DD14,DF14,DH14,DJ14,DL14,DN14,DP14 I...
1
16401
by: fadi980 | last post by:
Hi, I'm exporting a data set into excel file from an ASP.NET application (VS 2008). On my PC, i got everything working just fine. but on my client server i got the error ( Exception from HRESULT: 0x800A03EC ), and i found that the problem is in this call: wb.SaveAs(FPath, Excel.XlFileFormat.xlXMLSpreadsheet, Type.Missing, Type.Missing, false, false, Excel.XlSaveAsAccessMode.xlNoChange, Type.Missing, Type.Missing, Type.Missing,...
0
8310
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
8827
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
8732
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
8605
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
7333
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
6167
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
4315
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
1957
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
2
1620
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.