来自HRESULT的异常:使用Value2.ToString时为0x800A03EC [英] Exception from HRESULT: 0x800A03EC while using Value2.ToString
问题描述
大家好,
我遇到了这个问题.
我正在从Excel工作表中读取文本数据.
我用的是线
while(((((Microsoft.Office.Interop.Excel.Range)workSheet.Cells [rowIndex,colIndex1]).Value2!= null)//确定直到此处.:thumbsup:
{
字符串firstName =((Microsoft.Office.Interop.Excel.Range)workSheet.Cells [rowIndex,colIndex1]).Value2.ToString();//异常在这里.:confused:
//更多代码在这里.
}
但这给了我一个异常来自HRESULT的异常:0x800A03EC".
注意:我正在使用C#,并且添加了micorsoft对象库11和excel对象库11
请帮我解决这个问题.
我浏览了google,那里有关于一些regionoptions的信息,但是我不认为这对我来说应该是个问题,因为我只是在阅读文本.
Hello All,
I came across this problem.
I am reading Text Data from Excel sheet.
I use the lines
while (((Microsoft.Office.Interop.Excel.Range)workSheet.Cells[rowIndex, colIndex1]).Value2 != null)//OK until here.:thumbsup:
{
string firstName = ((Microsoft.Office.Interop.Excel.Range)workSheet.Cells[rowIndex, colIndex1]).Value2.ToString();// exception is here.:confused:
//some more code goes here.
}
but this gives me an exception "Exception from HRESULT: 0x800A03EC".
NOTE: i am using C# and i have added micorsoft object library 11 and excel object library 11
Please help me how this problem can be solved.
I went through google where there was information about some regionaloptions but i dont think that should be a problem in my case as i am just reading text.
推荐答案
http://social.msdn.microsoft.com/Forums/en -US/vsto/thread/412dd4d6-df62-449c-bb3b-f53cb408ab68
在那里看看,也请点击下面的链接.
如下面的链接所述,这可能是一个安全问题.
http://support.microsoft.com/kb/282830/
http://social.msdn.microsoft.com/Forums/en-US/vsto/thread/412dd4d6-df62-449c-bb3b-f53cb408ab68
Have a look there but also at the link below.
It could be a security issue as described in link below.
http://support.microsoft.com/kb/282830/
这篇关于来自HRESULT的异常:使用Value2.ToString时为0x800A03EC的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!