与MS Excel 2007交互的工作流活动中的错误 [英] Error in workflow activity that interact with MS Excel 2007

查看:65
本文介绍了与MS Excel 2007交互的工作流活动中的错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

嗨!

我正在尝试构建与MS Excel 2007交互的自定义​​工作流活动.

我编写了以下代码来创建和显示excel应用程序.

Excel._Application excelApp =新的Excel.ApplicationClass();
Excel.Workbooks工作簿= excelApp.Workbooks;
excelApp.SheetsInNewWorkbook = 1;
Excel.工作簿工作簿= workbooks.Add(missing);
excelApp.Visible = true;


但是应用程序仍然不可见.在调试代码时,我发现"excelApp.Visible"仍然等于假".

我应该怎么做才能在Excel中显示工作簿?

谢谢

Hi!

I'm trying to build a custom workflow activity that interact with MS Excel 2007.

I wrote a following code to create and show an excel application.

         Excel._Application excelApp = new Excel.ApplicationClass();
         Excel.Workbooks workbooks = excelApp.Workbooks;
         excelApp.SheetsInNewWorkbook = 1;
         Excel.Workbook workbook = workbooks.Add(missing);
         excelApp.Visible = true;


But application is not still visible. When I'm debugging my code I find that "excelApp.Visible" still equals "false".

What should I do to show Workbook in Excel?

Thanks

推荐答案

VSTO论坛以VSTO技术为目标,该技术是与Office应用程序一起在进程内运行并扩展用户界面的一组工具.您的问题不是VSTO,也不是该技术会遇到的情况,因此它不在主题之列,我将把它移出论坛.您可以在
The VSTO forum targets the VSTO technology, a set of tools that run in-process with the Office applications and extend the user interface. Your question is not VSTO and is not a scenario the technology would run into, so it's off-topic and I will be moving it out of the forum. You'll find a list of links to venues for non-VSTO, Office-related questions in the Please Read First message pinned at the top of the forum. I recommend the set of Office.developer newsgroups for this type of question, or possibly the excel.programming newsgroup (but they won't answer C# questions).

FWIW, you should not be using the _Application or the Excel.ApplicationClass. You should be using
    Excel.Application excelapp = new Excel.Application();

I don't know if this is what's behind your problem, but making the change could help.


这篇关于与MS Excel 2007交互的工作流活动中的错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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