访问Excel工作簿时出现问题 [英] Problem accessing Excel workbook

查看:74
本文介绍了访问Excel工作簿时出现问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述



在我们的应用程序中访问现有的excel工作簿时,我们一直遇到问题.下面是在我们的应用程序中使用excel的详细方法:

我们在我们的应用程序中使用excel工作簿只是为了显示从数据库中读取的数据.在这种情况下,我们可以创建一个新的工作簿,也可以使用现有的工作簿,然后显示数据.我们在使用现有工作簿时面临问题,错误是服务器抛出异常",该消息显示在带有确定"按钮的小消息框中.通过单击确定"按钮,我们可以按原样使用excel.但是问题就出在这里,就是每当我们不止一个使用现有工作簿时,都会出现此问题.

下面是我们在添加excel工作表时使用的一段代码:

:: Add(const VARIANT& Before,const VARIANT& After,const VARIANT& Count ,const VARIANT& Type)
{
LPDISPATCH结果;
静态BYTE parms [] =
VTS_VARIANT VTS_VARIANT VTS_VARIANT VTS_VARIANT;
InvokeHelper(0xb5,DISPATCH_METHOD,(VT_DISPA void *)& result,parms,
& Before,& After,& Count,& Type);
返回结果;
}

如果我们缺少任何东西或需要其他任何东西,请告诉我们.

谢谢,
Siva

Hi,

We have been experiencing a problem wihile accessing an existing excel workbook in our application. Below is the detailed way of using excel in our application:

We use excel workbook in our application just to display data that is read from the database. In this, we can either create a new workbook or can use an existing one and then display the data. We are facing the problem while using the existing workbooks and the error is "The server threw an exception", displayed in a small message box with just OK button. By clicking OK button, we can use the excel as it is. But the problem lies here is everytime we use the existing workbooks more than one, this problem occurs.

Below is a piece of code that we are using while adding the excel sheets:

::Add(const VARIANT& Before, const VARIANT& After, const VARIANT& Count, const VARIANT& Type)
{
  LPDISPATCH result;
  static BYTE parms[] =
    VTS_VARIANT VTS_VARIANT VTS_VARIANT VTS_VARIANT;
  InvokeHelper(0xb5, DISPATCH_METHOD, VT_DISPATCH, (void*)&result, parms,
    &Before, &After, &Count, &Type);
  return result;
}

Please let us know if we are missing any thing or need to anything else. Any pointers on this would help us a lot.

Thanks,
Siva

推荐答案


感谢您的帖子!不幸的是,当前没有论坛发布您要提问的问题,因此我建议您将问题发布到以下Microsoft.public.excel.crashesgpfs新闻组之一:

希望有帮助!


这篇关于访问Excel工作簿时出现问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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