Excel在DoCmd.TransferSpreadsheet之后保留在RAM中 [英] Excel stays in RAM after DoCmd.TransferSpreadsheet

查看:90
本文介绍了Excel在DoCmd.TransferSpreadsheet之后保留在RAM中的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

您好,


我搜索了所有谷歌群组和互联网,但我没有

找到了解决这个问题的解决方案。我找到的解决方案

帮我挑出导致问题的那一行。


我以编程方式从Access打开一个Microsoft Excel文件,做一些

数据检查等,定义命名范围,执行

DoCmd.TransferSpreadsheet,然后删除范围,将所有引用的

对象设置为Nothing然而,Excel留在内存中。


还有其他代码也处理Excel应用程序,如果我

注释掉DoCmd.TransferSpreadsheet Excel已从内存中清除。


TransferSpreadsheet方法调用后是否需要一些东西

来断开Access / Excel之间的联系?


非常感谢你!

解决方案

我在这里完全猜测,但我想你需要强制对MS Excel对象强制执行

。问题是,我不确定是怎么设置




设置MSExcel = Nothing


您需要找出MSExcel的内容。以上需要。


然后,我可能完全错了。


HTH


这是其他人遇到同样问题的地方。
http://www.utteraccess.com/forums/sh...8861&bodyprev=


这是建议的内容。

设置xlApp =没有

我想我可能是对的!


感谢您的回复。


实际上我知道,而且我已经在做了。


该版本适用于我用Excel做的所有事情,除了

当我添加一个l DoCmd.TransferSpreadsheet的ine。这个方法中有什么东西可以用某种方式与Excel结合吗?


Hello,

I have searched all over google groups and internet, but I have not
found a solution to this problem that has worked. The solutions I found
helped me single out the line that is causing the problem, though.

I programmatically open a Microsoft Excel file from Access, do some
data checks etc., define a named range, perform
DoCmd.TransferSpreadsheet, then delete the range, set all referenced
objects to Nothing, etc. However, Excel stays in memory.

There is other code that deals with Excel application too, and if I
comment out DoCmd.TransferSpreadsheet the Excel is cleared from memory.

Is there something that TransferSpreadsheet method needs after its call
to disconnect the tie between Access/Excel?

Thank you so much!

解决方案

I am totally guessing here, but I am thinking that you need to force a
relase of the MS Excel object. The issue is, I am not sure how it is
being set.

Set MSExcel = Nothing

You need to find out what the "MSExcel" above needs to be.

Then again, I could be totally wrong.

HTH


Here is where someone else is having the same issue.
http://www.utteraccess.com/forums/sh...8861&bodyprev=

Here is what was suggested.
set xlApp = nothing
I think I may have been right!


Thanks for the reply.

Actually I know that, and I am already doing it.

The release works for everything that I am doing with Excel, except
when I add that one line of DoCmd.TransferSpreadsheet. Is there
something inside this method that ends up tied to Excel somehow?


这篇关于Excel在DoCmd.TransferSpreadsheet之后保留在RAM中的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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