//导入电子表
private void btnImport_Click(object sender, EventArgs e)
{
string ofp = String.Empty;
OpenFileDialog ofd = new OpenFileDialog();
ofd.Filter = "Microsoft Excel(*.xml)|*.xml";
if (ofd.ShowDialog(this) == DialogResult.OK)
{
ssheet.XMLURL = ofd.FileName; //这里出错!(对 COM 组件的调用返回了错误 HRESULT E_FAIL。)
}
ofd.Dispose();
}
在线等!。。
private void btnImport_Click(object sender, EventArgs e)
{
string ofp = String.Empty;
OpenFileDialog ofd = new OpenFileDialog();
ofd.Filter = "Microsoft Excel(*.xml)|*.xml";
if (ofd.ShowDialog(this) == DialogResult.OK)
{
ssheet.XMLURL = ofd.FileName; //这里出错!(对 COM 组件的调用返回了错误 HRESULT E_FAIL。)
}
ofd.Dispose();
}
在线等!。。
地址不对,你设断点看看FileName是不是地址显示
:http://hi.baidu.com/xtuwangzhi/blog/item/85e857916fbb6e85a877a4cf.html
参考