一条关于excel控件owc11的问题。
我用了owc11这个excel控件,生成的代码如下:
String str;
AxSpreedSheet m_Exlprt = new AxSpreedSheet();
((Range)m_Exlprt.Cells[1,2]).Value2 = "aaa";
str = ((Range)m_Exlprt.Cells[1,2]).Value2 as String;
此时str的值是"aaa", 但是我假如将数字的字符串赋值给单元格,如下所示:
((Range)m_Exlprt.Cells[1,2]).Value2 = "22";
str = ((Range)m_Exlprt.Cells[1,2]).Value2 as String;
此时str得到的值怎么为null呢?请问我如何才能将str变量的值变为"22"?