DDE 服务器窗口 - 应用程序错误
我有一个 ac# 应用程序,它打开 excel 的 COM 实例,并通过 oleDB 将 Access 2000 数据库中的一些数据转储到工作表上,然后释放 excel 对象,但是在关闭程序后我得到一个带有标题栏的窗口:
DDE Server Error: [applicationName.exe] - Application Error
我认为我已将问题范围缩小为在关闭程序之前关闭 Excel 的问题。 考虑到这是我创建的 com 对象的问题,我检查了代码并尝试找到存储 Excel COM 对象的每个位置,并确保在将其设置为 null 之前将其释放。 我忽略了那些我没有存储的对象,例如
excelSheet.GetRange("A1", "A1).Value2 = "Hello";
我仍然收到错误,并且我认为我已经释放了所有存储的 COM 对象,是否还有其他原因导致我仍然收到此错误?
I have a c# application that opens up a COM instance of excel and dumps some data from an Access 2000 database via oleDB onto the sheet then releases the excel object, but I get a window after I close the program with the title bar:
DDE Server Error: [applicationName.exe] - Application Error
I think I've narrowed this down to be an issue with closing excel before I close my program. Figuring this was an issue with the com objects I created, I went through my code and tried to find every place where I stored an Excel COM object and make sure it was released before setting it to null. I ignored ones I didn't store e.g.
excelSheet.GetRange("A1", "A1).Value2 = "Hello";
I still recieve the error and I think I've released all my stored COM objects, is there another reason I might still be getting this error?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
也许您没有正确清理 Excel 引用?
查看此线程了解如何操作这。
Perhaps you're not properly cleaning up your Excel references?
Check out this thread on how to do this.