Disable warning: you have copied a large amount of data to the clipboard

When debugging queries written in MS Access 2007 (the problem was the same in all previous versions), I ran the query and copied the results to Excel. Depending on the results, I switch the package in Access to refine the results and return to query development mode. At the moment, 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 never wanted to do this.

The MS Office clipboard is disabled, so this function is performed with the standard Windows clipboard. Is there a way to disable the warning and consider No as the default?

+3
source share
7

. , . , , , .

, , , :

Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
    :=False, Transpose:=False
Windows("iostatZd15.1").Activate
ActiveWindow.WindowState = xlNormal
ActiveSheet.Range("A1").Copy
ActiveWindow.Close

( ) "dummy" - (BIG) . .

+3

, , , MS. :

  • .
  • "", "". regedit "".
  • , (): HKey_CURRENT_USER\Software\Microsoft\Office\9.0\Common\General
  • "" "" " DWORD". New Value # 1 AcbControl .
  • "" "". " DWORD" "" "". 1 . "" .

. ( ) Office Office, .

MS KB

+1

, . Excel Access? , .

:

- , :

  DoCmd.SetWarnings False

.

, .

, . , , , , , ? , SetWarnings .

, , Screen.ActiveDatasheet . , , :

  Public Function ChangeWarnings(bolSetting As Boolean) As Boolean
    DoCmd.Setwarnings bolSetting
  End Function

... , , "" :

  Screen.ActiveDatasheet.OnActivate = "=ChangeWarnings(False)"
  Screen.ActiveDatasheet.OnDeactivate = "=ChangeWarnings(True)"

, .

- "" Screen.ActiveDatasheet . , .

+1

OnClose , .

.

Private Declare Function apiOpenClipboard Lib "User32" Alias
"OpenClipboard" (ByVal hWnd As Long) As Long

Private Declare Function apiEmptyClipboard Lib "User32" Alias
"EmptyClipboard" () As Long

Private Declare Function apiCloseClipboard Lib "User32" Alias
"CloseClipboard" () As Long

Function EmptyClipboard()
  If apiOpenClipboard(0&) <> 0 Then
    Call apiEmptyClipboard
    Call apiCloseClipboard
  End If
End Function

Close :

EmptyClipboard
+1

Excel:

Fexcel = New Microsoft.Office.Interop.Excel.Application
Fexcel.DisplayAlerts = False

Access

0

Application.CutCopyMode = False

0

. , .

' Copy something small into the clipboard
Range("A1").Copy

' Turn off CutCopyMode i.e., the "crawling ants"
' Application.CutCopyMode = False solves a lot of problems, I do it as a precaution after I copy anything
Application.CutCopyMode = False

CutCopyMode = FALSE ( )

0

Source: https://habr.com/ru/post/1704762/


All Articles