禁用警告:您将大量数据复制到剪贴板
在调试用 MS Access 2007 编写的查询时(所有以前的版本中的问题也相同),我将运行查询,然后将结果复制到 Excel 中。 根据结果,我将批处理切换到 Access 以优化结果并返回查询的设计模式。 此时,我收到一个恼人的警告:您将大量数据复制到剪贴板上。 ...您想将这些数据保存在剪贴板上吗?
我从来没有想过这样做。
MS Office 剪贴板被禁用,因此此功能在标准 Windows 剪贴板中发生。 有没有办法禁用警告并假设“否”为默认值?
While debugging queries written in MS Access 2007 (problem was the same in all previous versions too), I'll run the query and then copy the results into Excel. Depending on results, I switch batch to Access to refine the results and go back into design mode of the query. At this point, I get an annoying warning: you copied a large amount of data onto the clipboard. ...Do you want to save this data on the clipboard?
I have never wanted to do this.
The MS Office clipboard is disabled so this function is happening with the standard Windows clipboard. Is there a way to disable the warning and assume No as the default?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(7)
有一个非常简单的解决方案。 仅当剪贴板上有大量内容时才会出现警告消息。 因此 - 在关闭之前确保那里只有少量的东西。
例如,在我编写的宏中,我这样做:
倒数第二行(紧接在关闭之前)是一个“虚拟” - 一个简单地用非常少量的数据替换当前(大)剪贴板的命令。 有用。
There is a very easy solution to this. The warning message only happens if there is a LARGE amount of stuff on the clipboard. Therefore - make sure there is only a small amount of stuff there before you close.
For example, in a macro I wrote I do this:
The second-last line (immediately before the close) is a "dummy" - a command to simply replace the current (BIG) clipboard with a very small amount of data. It works.
我想你可能必须禁用 MS 剪贴板。 试试这个:
HKey_CURRENT_USER\Software\Microsoft\Office\9.0\Common\General
注意:您无法通过修改注册表来仅禁用(或启用)单个 Office 程序的 Office 剪贴板。
这是 MS 知识库文章
I think you may have to disable the MS clipboard. Try this:
HKey_CURRENT_USER\Software\Microsoft\Office\9.0\Common\General
NOTE: You cannot disable (or enable) the Office Clipboard for only a single Office program by modifying the registry.
Here's the MS KB article
您可以设置窗体的 OnClose 事件来清除剪贴板。
将以下代码放入数据库的模块中。
然后在表单的 Close 事件中使用:
You could set the OnClose event of the form up to clear the clipboard.
Put the below code into a module in your database.
Then in the Close event of your form use:
根据我的经验,只有在关闭应用程序时您才会收到此消息。 返回 Access 之前是否要关闭 Excel? 如果是这样,请不要关闭它,看看是否不再收到该消息。
在尝试产生错误的说明后进行编辑:
避免错误消息的唯一方法是在进入设计视图之前关闭通知,如下所示:
并且您希望在完成编辑后将其重新打开。
但没有地方可以运行此代码,因为您只是使用 Access UI 来编辑查询。
我不太明白为什么这个警告被认为是一个问题。 也许您正在粘贴,返回设计视图,更改标准,再次运行,再次粘贴? 如果是这样,关闭 SetWarnings 可能会成功。
如果您希望它自动发生,您可以使用 Screen.ActiveDatasheet 对象来执行此操作。 您想要做的是编写一个函数:
...然后当您在数据表视图中打开查询时,在“立即”窗口中键入这两行:
您当然也可以编写为您设置此功能的代码。
需要注意的是,当打开或关闭另一个对象时,它不会“粘住”Screen.ActiveDatasheet 对象。 它仅适用于您分配事件操作时处于活动状态的数据表。
In my experience, you only get this message when you close an application. Are you closing Excel before returning to Access? If so, don't close it and see if you no longer get the message.
EDIT after trying instructions for producing the error:
The only way to avoid the error message is to turn off notifications before entering design view, as in:
And you'd want to turn it back on after you are done with your editing.
But there's no place to run this code, since you're just using the Access UI to edit a query.
I don't quite understand why this warning is considered a problem. Maybe you're pasting, going back to design view, changing criteria, running again, pasting again? If so, turning SetWarnings off might do the trick.
If you wanted it to happen automatically, you could conceivably use the Screen.ActiveDatasheet object to do this. What you'd want to do is write a function:
...then when you open your query in datasheet view, in the Immediate window, type these two lines:
You could also certainly write code that sets this up for you.
One note -- it doesn't "stick" for the Screen.ActiveDatasheet object when opening or closing a different one. It applies only to the Datasheet that is active when you assign the event actions.
对于 Excel:
对 Access 执行相同操作
For Excel:
Do same for Access
应用程序.CutCopyMode = False
Application.CutCopyMode = False
我一直遇到这个问题。 必须这样做似乎很愚蠢,但以下解决方案可以杀死它。
CutCopyMode = FALSE 不会关闭所有剪贴板复制(如另一张海报所述)
I run into this problem all the time. It seems silly to have to do this, but the following solution kills it dead.
CutCopyMode = FALSE does not turn off the all clipboard copying (as stated by another poster)