Results 1 to 10 of 570

Thread: Tests Copying, Pasting, API Cliipboard issues. and Rough notes on Advanced API stuff

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #11
    Fuhrer, Vierte Reich DocAElstein's Avatar
    Join Date
    Aug 2014
    Posts
    10,457
    Rep Power
    10
    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 :

    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 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
    Yaz: I have changed 2& to 0& to avoid error then I got 0 at the immediate window and then another error at this part
    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.
    Last edited by DocAElstein; 10-28-2024 at 02:39 PM.

Similar Threads

  1. Some Date Notes and Tests
    By DocAElstein in forum Test Area
    Replies: 5
    Last Post: 03-26-2025, 02:56 AM
  2. Replies: 116
    Last Post: 02-23-2025, 12:13 AM
  3. Replies: 21
    Last Post: 12-15-2024, 07:13 PM
  4. Replies: 42
    Last Post: 05-29-2023, 01:19 PM
  5. Replies: 11
    Last Post: 10-13-2013, 10:53 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •