Continued from last post…..
So back in early 2019 we were all stuck, even that Arab guru, Jaafar Tribak
If you look at just one of his / "mine" failed attempts it was approximately this, and it did work in Offices 2003, 2007, 2010 and 2013, but not in Office 2016. I will call this and similar ones the small coding to distinguish it from the big ones that
Code:
Option Explicit
#If VBA7 Then
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
#Else
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
#End If
Sub ClearOfficeClipBoard2003200720102013()
Dim avAcc, bClipboard As Boolean, j As Long
Dim MyPain As String ' COMsOLEwollupsActivelyEmmbeddedXratedObjectHookMyBoutonOhFolloks
If CLng(Val(Application.Version)) <= 11 Then ' Case 11: "Excel 2003" Windows "Excel 2004" mac
Let MyPain = "Task Pane"
Else
Let MyPain = "Office Clipboard"
End If
Set avAcc = Application.CommandBars(MyPain) '
Let bClipboard = avAcc.Visible
If Not bClipboard Then
Let avAcc.Visible = True ' Opens the main Parent viewer thing for the Office clipboard on XL 2007 + but sometimes opens the OfficeOnline in XL 2003?
Let Application.DisplayClipboardWindow = True ' Just incase the last line did not work
DoEvents
End If
For j = 1 To 4 '
AccessibleChildren avAcc, Choose(j, 0, 3, 0, 3), 1, avAcc, 1
Next
avAcc.accDoDefaultAction 2& '1& for paste
Let Application.CommandBars(MyPain).Visible = bClipboard '
End Sub
Bookmarks