The last post, #102 won't edit Okt 2024
This is post #103 https://www.excelfox.com/forum/showt...ll=1#post17968
https://www.excelfox.com/forum/showthread.php/2824-Tests-Copying-pasting-Cliipboard-issues?p=17968&viewfull=1#post17968
https://www.excelfox.com/forum/showt...ge11#post17968
https://www.excelfox.com/forum/showthread.php/2824-Tests-Copying-pasting-Cliipboard-issues/page11#post17968
Jaf: : Can you run this and tell us the output you get in the immediate window :
Yaz: I have changed 2& to 0& to avoid error then I got 0 at the immediate window and then another error at this partCode: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 ClearOfficeClipBoard() 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) bClipboard = avAcc.Visible If Not bClipboard Then avAcc.Visible = True 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 Dim a As IAccessible Dim i As Long Set a = avAcc For i = 0 To a.accChildCount Debug.Print i & vbTab & a.accName(i) Next Application.CommandBars(MyPain).Visible = bClipboard End Sub
a.accName(i)
In valid procedure call or argument
Jaf: Can you place an On Error Resume Next statement right before :
Set a = avAcc
Yaz: I just got 0 in the immediate window
And I put the line before the line of
avAcc.accDoDefaultAction 2&
and I got also 0
Alan 2024
2003 (German)
0 Zusammenstellen und Einfügen 2.0
1 Alle einfügen
2 Alle löschen
3 Klicken Sie zum Einfügen auf ein Element:
4 Zwischenablage
5 Zwischenablage
6 Um diesen Aufgabenbereich später einzublenden, wählen Sie Office-Zwischenablage aus dem Menü Bearbeiten oder drücken Sie Strg+C zwei mal.
7 Optionen
2007 (English)
0 Collect and Paste 2.0
1 Paste All
2 Clear All
3 Click an item to paste:
4 Clipboard
5 Clipboard
6 Options
2010 2013 (German) ( KB 32 Bit Office 2010 ' 64 Bit windows Office 2010 Veranda Office 2013 SerSzuD2)
0 Zusammenstellen und Einfügen 2.0
1 Alle Einfügen
'2 Alle löschen
3 Klicken Sie zum Einfügen auf ein Element:
4 Zwischenablage
5 Zwischenablage
6 Optionen
All other results as Yasser
Jaf: I don't know why it doesn't work in office 2016. Maybe the hierarchy of the Accessibility buttons is different from that of previous office editions --- unfortunately, I don't use excel 2016 so I could test it.




Reply With Quote
Bookmarks