来自HRESULT的异常:0x800A03EC [英] Exception from HRESULT:0x800A03EC

查看:92
本文介绍了来自HRESULT的异常:0x800A03EC的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

以下是我的代码段:

Below is my code snippet:

Dim ef2 As New Microsoft.Office.Interop.Excel.Application
Dim ws As New Microsoft.Office.Interop.Excel.Worksheet

'Imports all the tables from DataSet to new file.
For Each table In [dsExportToSAPData].Tables
    'Add new worksheet to the file.
    ws = ef2.Worksheets.Add(table.TableName)

    'Change the value of the first cell in the DataTable.;
    table.Rows(0)(0) = "This is new file!"

    'Insert the data from DataTable to the worksheet starting at cell "A1".
    ws.InsertDataTable(table, "A1", True)
Next



这里的问题是当下面的行执行时,得到异常来自HRESULT的异常:0x800A03EC... ws = ef2.Worksheets.Add(table.TableName)...任何人都可以帮忙解决这个异常的问题吗?


Problem here is am getting the Exception "Exception from HRESULT:0x800A03EC" when the below line executed...ws = ef2.Worksheets.Add(table.TableName)... Can anyone help how to solve this exception ?

推荐答案

excel是否从索引0开始?

例如,这里:

http://www.techonthenet.com/excel/formulas/row.php [ ^ ]索引似乎从1开始。

尝试更改

Does excel starts from index 0?
For example, here:
http://www.techonthenet.com/excel/formulas/row.php[^] it seems that indexing starts from 1.
Try changing
table.Rows(0)(0) = "This is new file!"





to



to

table.Rows(1)(1) = "This is new file!"


检查这个



http://forums.asp.net/t/1406817.aspx/1 [ ^ ]

< br>

tari maa no bhosdo ...... bhenchhod ..... chhodu jeva page na banavishh
tari maa no bhosdo......bhenchhod.....chhodu jeva page na banavishh


这篇关于来自HRESULT的异常:0x800A03EC的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆