Visual Studio程序破坏Excel应用程序 [英] Visual Studio Program Corrupting Excel Application

查看:86
本文介绍了Visual Studio程序破坏Excel应用程序的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在运行一个可视工作室程序来控制一套实验室测试设备。我正在从网络分析仪请求数据并将数据记录到Excel文件中(Excel 2013)。每次运行程序时,excel应用程序都会生成灰色屏幕
而没有任何显示的数据。在我停止程序后,我可以在Apps& amp;功能菜单。当我运行修复并重新启动计算机时,文件会正常打开并显示预期的数据。我希望能够运行程序
而无需每次都修复办公室。我在visual C#中使用excel互操作服务来创建excel应用程序和日志数据。还有其他人遇到过这个问题吗?任何信息都会非常感激。

I am running a visual studio program to control a set laboratory test equipment. I am requesting data from a network analyzer and logging the data into an excel file (Excel 2013). Every time I run the program, the excel application results in a grey screen without any displayed data. After I stop the program I can repair Microsoft Office in the Apps & Features menu. When I run the repair and restart the computer, the file opens normally with the expected data displayed. I want to be able to run the program without having to repair office every time. I am using excel interop services in visual C# to create the excel application and log data. Has anyone else ran into this issue? Any information would be much appreciated.

推荐答案

我之前遇到过使用互操作的问题。 您是否考虑过使用
EPPlus
。 它使用OOXML创建Excel文件。 您在机器上不需要Excel。 它易于使用,可以创建图表。 有一个.Net Core 2.0的版本,所以如果需要你可以在Linux上运行它。  


$

I've had problems previously with interops.  Have you considered using EPPlus.  It uses OOXML to create the Excel file.  You don't need Excel on the machine.  It is easy to use and can create graphs.  There is a version for .Net Core 2.0 so if needed you can run it on Linux.  

我打算将它用于项目,但我需要汇总PDF报告。 我使用C#并将所有数据存储在SqLite数据库中。 然后我编写了一个VBA插件(.xlsm),用于从db创建报告。 通过VBA,我能够使用复杂的
图表和数据透视表创建报告。 

I was going to use it for a project but I needed summary PDF reports.  I used C# and stored all the data in an SqLite database.  I then wrote a VBA addin (.xlsm) that creates reports from db.  With VBA I was able to create reports with complex graphs and pivot tables. 


这篇关于Visual Studio程序破坏Excel应用程序的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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