无法关闭Excel进程 [英] Can't Close Excel Process

查看:338
本文介绍了无法关闭Excel进程的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好,


我打开一个excel文档,对它进行一些操作,然后在Access中通过VBA关闭它并释放对它的引用。然而,当它关闭时,这个过程并没有结束,我以后再也无法打开它。


我看过其他帖子并看到我应该添加以下内容:


System.Runtime.InteropServices.Marshal.ReleaseComO bject(appExcel)

GC.Collect()


我是新手,只是把它们放进去了:

展开 | 选择 | Wrap < span class =codeDivider> | 行号

解决方案

< blockquote>你和O之间有一个空格。


谢谢,


Whe我删除它给了我错误:变量未定义,突出显示系统


你在O和bject之间有一个空格。


据我所知,从快速谷歌搜索,System对象不是Visual Basic for Applications的一部分,它是Visual的一部分基本。它们不是同一品种。 VBA是Microsoft Office Applications使用的。我会看看是否有其他专家知道如何在VBA中这样做。


Hi everyone,

I open an excel document, do some manipulation to it, and then close it through VBA in Access and free the references to it. When it closes, however, the process doesn''t end and I have trouble opening it again later.

I''ve looked at other postings and seen that I should add the following:

System.Runtime.InteropServices.Marshal.ReleaseComO bject(appExcel)
GC.Collect()

I''m new at this, and just stuck those in:

Expand|Select|Wrap|Line Numbers

解决方案

You have a space between O and bject.


Thanks,

When I removed it gave me the error: Variable not defined, highlighting "System"

You have a space between O and bject.


As far as I can tell from a quick google search, the System object is not a part of Visual Basic for Applications, it is a part of Visual Basic. They are not the same breed. VBA is what Microsoft Office Applications use. I''ll see if any of the other experts know how to do this in VBA.


这篇关于无法关闭Excel进程的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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