die Lösung bzw hiermit klappt es:
Option Explicit
#If VBA7 Then
Private Declare PtrSafe Function AccessibleChildren Lib "oleacc" ( _
ByVal paccContainer As Office.IAccessible, _
ByVal iChildStart As Long, ByVal cChildren As Long, _
ByRef rgvarChildren As Any, ByRef pcObtained As Long) As Long
Public Const mVBA7 As Long = 1
#Else
Private Declare Function AccessibleChildren Lib "oleacc" ( _
ByVal paccContainer As Office.IAccessible, _
ByVal iChildStart As Long, ByVal cChildren As Long, _
ByRef rgvarChildren As Any, ByRef pcObtained As Long) As Long
Public Const mVBA7 As Long = 0
#End If
'Public Sub EvRClearOfficeClipBoard()
Public Sub Zwischenablage()
Application.DisplayAlerts = False
Application.ScreenUpdating = False
Dim cmnB, IsVis As Boolean, j As Long, Arr As Variant
Arr = Array(4, 7, 2, 0) '4 und 2 für 32 bit, 7 und 0 für 64 bit
On Error GoTo Fehler
Set cmnB = Application.CommandBars("Office Clipboard")
IsVis = cmnB.Visible
If Not IsVis Then
cmnB.Visible = True
DoEvents
End If
For j = 1 To Arr(0 + mVBA7)
AccessibleChildren cmnB, Choose(j, 0, 3, 0, 3, 0, 3, 1), 1, cmnB, 1
Next
On Error Resume Next
cmnB.accDoDefaultAction CLng(Arr(2 + mVBA7))
If Application.CommandBars("Office Clipboard").Visible = True Then Application.CommandBars("Office Clipboard").Visible = False
Fehler:
If Application.CommandBars("Office Clipboard").Visible = True Then Application.CommandBars("Office Clipboard").Visible = False
End Sub
|