Page 18 of 56 FirstFirst ... 8161718192028 ... LastLast
Results 171 to 180 of 554

Thread: Tests Copying pasting Cliipboard issues. and otes on API stuff

  1. #171
    Fuhrer, Vierte Reich DocAElstein's Avatar
    Join Date
    Aug 2014
    Posts
    9,458
    Rep Power
    10

    Jaafar’s got a big one, but it doesn’t work for Excel 2016? Why?

    Jaafar’s got a big one, but it doesn’t work for Excel 2016? Why?
    This page 18 from post 171 / 18036 is for some notes to possibly help in getting this big macro to also work for Office 2016 and higher
    Last edited by DocAElstein; 11-07-2024 at 09:35 PM.

  2. #172
    Fuhrer, Vierte Reich DocAElstein's Avatar
    Join Date
    Aug 2014
    Posts
    9,458
    Rep Power
    10
    Last edited by DocAElstein; 10-30-2024 at 12:57 PM.

  3. #173

  4. #174
    Fuhrer, Vierte Reich DocAElstein's Avatar
    Join Date
    Aug 2014
    Posts
    9,458
    Rep Power
    10
    This is post #174
    https://www.excelfox.com/forum/showt...e18#post 18039
    https://www.excelfox.com/forum/showthread.php/2824-Tests-Copying-pasting-Cliipboard-issues/page18#post 18039
    https://www.excelfox.com/forum/showt...l=1#post 18039
    https://www.excelfox.com/forum/showthread.php/2824-Tests-Copying-pasting-Cliipboard-issues?p= 18039&viewfull=1#post 18039






    Spy++
    If you Google around for things like Microsoft Windows Spy++ and / or alternatives to that, then you will get some software offered that tells you some things about what is going on in windows. As part of trying to get clued up on things API and clipboard, I have looked at a small part of the explorer/tree like thing presented by such software around an Excel File, in particular to see if I can get any useful info about the Offices Clipboard Viewer, ( the thing pictured in the previous 2 posts above,
    https://www.excelfox.com/forum/showt...ll=1#post18037
    https://www.excelfox.com/forum/showt...ll=1#post18038
    )


    The following pics are in pairs for some different Office versions. The left is for before and the right for after, opening the OfficesClipboardViewer

    Excel 2003

    https://i.postimg.cc/SKGKFhkG/Excel-...ard-Viewer.jpg Excel 2003 Spy the OfficesClipboardViewer.jpg
    https://i.postimg.cc/SsskBYZy/XL-200...ard-Viewer.jpg -------------------- https://i.postimg.cc/YS8tDzzn/XL-200...ard-Viewer.jpg





    Excel 2007

    https://i.postimg.cc/tgbgMTQT/Excel-...ard-Viewer.jpg Excel 2007 Spy the OfficesClipboardViewer.jpg
    https://i.postimg.cc/QCKstGGw/XL-200...ard-Viewer.jpg ----------------------- https://i.postimg.cc/zBc88DMT/XL-200...ard-Viewer.jpg





    Excel 2010





    Excel 2013

    https://i.postimg.cc/RCYZzG52/Excel-...ard-Viewer.jpg Excel 2013 Spy the OfficesClipboardViewer.jpg
    https://i.postimg.cc/c4841YdC/XL-201...ard-Viewer.jpg ------------------------------------- https://i.postimg.cc/4xk4Yd35/XL-201...ard-Viewer.jpg








    Excel 2016

    https://i.postimg.cc/sxMfhGSn/Excel-...ard-Viewer.jpg Excel 2016 Spy the OfficesClipboardViewer.jpg
    https://i.postimg.cc/W1GNgvFP/XL-201...ard-Viewer.jpg --------------------- https://i.postimg.cc/7LqxNW0J/XL-201...ard-Viewer.jpg
    Last edited by DocAElstein; 11-06-2024 at 12:37 AM.

  5. #175
    Fuhrer, Vierte Reich DocAElstein's Avatar
    Join Date
    Aug 2014
    Posts
    9,458
    Rep Power
    10
    Last edited by DocAElstein; 11-06-2024 at 01:31 AM.

  6. #176
    Fuhrer, Vierte Reich DocAElstein's Avatar
    Join Date
    Aug 2014
    Posts
    9,458
    Rep Power
    10
    The last post inspired me a bit to take another look at this snippet.
    Code:
    Let hwndClip = FindWindowEx(Application.hWnd, 0, "EXCEL2", vbNullString)
    Let hwndClip = FindWindowEx(hwndClip, 0, "MsoCommandBar", CommandBars(MyPain).NameLocal)
    Let hwndClip = GetNextWindow(hwndClip, GW_CHILD)
    Let hwndScrollBar = GetNextWindow(GetNextWindow(hwndClip, GW_CHILD), GW_CHILD)
        
        If hwndClip And hwndScrollBar Then
         GetWindowRect hwndClip, tRect1
         GetWindowRect hwndScrollBar, tRect2
         BringWindowToTop Application.hWnd
            For i = 0 To tRect1.Right - tRect1.Left Step 50
             tPt.x = tRect1.Left + i: tPt.Y = tRect1.Top - 10 + (tRect2.Top - tRect1.Top) / 2
                #If VBA7 And Win64 Then
                 CopyMemory lngPtr, tPt, LenB(tPt)
                 Let lResult = AccessibleObjectFromPoint(lngPtr, oIA, vKid)
                #Else
                 Let lResult = AccessibleObjectFromPoint(tPt.x, tPt.Y, oIA, vKid)
                #End If ' 
                If InStr("Clear All Borrar todo Effacer tout Alle löschen La légende du bouton", oIA.accName(vKid)) Then
                Call oIA.accDoDefaultAction(vKid) ' This does the clearing,  and
                     CommandBars(MyPain).Visible = Not bHidden ' 
                     Let bHidden = False
                      Exit Sub
                End If
             DoEvents
            Next i
        End If 
    I did some modifications to help take a closer look
    (The modifications are
    _ 1) a small change to prevent the code erroring if finds a button or something without any caption
    _2) some Debug.Print lines )

    Here is the modified version
    Code:
    '                                1180958
    Let hwndClip = FindWindowEx(Application.hwnd, 0, "EXCEL2", vbNullString):                 Debug.Print "hwndClip      " & hwndClip
    Let hwndClip = FindWindowEx(hwndClip, 0, "MsoCommandBar", CommandBars(MyPain).NameLocal): Debug.Print "hwndClip      " & hwndClip ' 591464
    Let hwndClip = GetNextWindow(hwndClip, GW_CHILD):                                         Debug.Print "hwndClip       " & hwndClip '   721906
    Let hwndScrollBar = GetNextWindow(GetNextWindow(hwndClip, GW_CHILD), GW_CHILD):           Debug.Print "hwndScrollBar " & hwndScrollBar  ' 787440
                                                                                              Debug.Print
        If hwndClip And hwndScrollBar Then
         GetWindowRect hwndClip, tRect1
         GetWindowRect hwndScrollBar, tRect2
         BringWindowToTop Application.hwnd
                                                                                              Debug.Print "  tRect1.Top   =  " & tRect1.Top & "   tRect2.Top  =  " & tRect2.Top
                                                                                              Debug.Print "( tRect1.Bottom = " & tRect1.Bottom & "   tRect2.Bottom = " & tRect2.Bottom & " )"
                                                                                              Debug.Print "Loop i from   0  To  (" & tRect1.Right & "-" & tRect1.Left & ")=" & tRect1.Right - tRect1.Left & "   Step 50"
            For i = 0 To tRect1.Right - tRect1.Left Step 50
             Let tPt.x = tRect1.Left + i
             Let tPt.Y = tRect1.Top - 10 + (tRect2.Top - tRect1.Top) / 2:                     Debug.Print "i=" & Format(i, "000") & "   tPt.x = " & tPt.x & "   tPt.Y = " & tPt.Y
                #If VBA7 And Win64 Then
                 CopyMemory lngPtr, tPt, LenB(tPt)
                 Let lResult = AccessibleObjectFromPoint(lngPtr, oIA, vKid)
                #Else
                 Let lResult = AccessibleObjectFromPoint(tPt.x, tPt.Y, oIA, vKid)
                #End If ' 
                                                                                              Debug.Print "lResult " & lResult & "   vKid " & vKid & "   oIA.accName(vKid) """ & oIA.accName(vKid) & """"
                If oIA.accName(vKid) <> "" And InStr("Clear All Borrar todo Effacer tout Alle löschen La légende du bouton", oIA.accName(vKid)) > 0 Then
                Call oIA.accDoDefaultAction(vKid) ' This does the clearing,  and
                     CommandBars(MyPain).Visible = Not bHidden ' 
                     Let bHidden = False
                                                                            Debug.Print "Worked,   :-)"
                     Stop: Exit Sub
                End If
             DoEvents
            Next i
        End If
    Let CommandBars(MyPain).Visible = Not bHidden
     Debug.Print "Unable to clear the Office Clipboard, didn't work,   :-("
    Stop
    End Sub
    

    Results in the next two posts
    https://www.excelfox.com/forum/showt...ll=1#post18042
    https://www.excelfox.com/forum/showt...ll=1#post18043
    Last edited by DocAElstein; 11-07-2024 at 07:05 PM.

  7. #177
    Fuhrer, Vierte Reich DocAElstein's Avatar
    Join Date
    Aug 2014
    Posts
    9,458
    Rep Power
    10

    Results for Excels 2003 2007 2010 2013

    Here are the results for Office 2003 2007 2010 2013, they are similar, and note that for those office versions, 2003 2007 2010 2013, the big coding does what we want (** when run ) and all is well
    ( ** when stepped through in debug F8 mode from the VBEditor , some versions do not work )




    2003
    https://i.postimg.cc/8CgCckTn/XL-200...ons-on-Run.jpgXL 2003 WinSpy & Dimensions on Run.jpg

    Code:
     ' Excel 2003 Klaus Notebook
    '  Results from Immediate window when Run the code, (from Excel or from the VBEditor)
    '    hwndClip 25888836
    '    hwndClip 29427046
    '    hwndClip 460018
    '    hwndScrollBar 656320
    '
    '      tRect1.Top   =  232   tRect2.Top  =  295
    '    ( tRect1.Bottom = 436   tRect2.Bottom = 376 )
    '    Loop i from   0  To  (853-653)=200   Step 50
    '    i=000   tPt.x = 653   tPt.Y = 254
    '    lResult 0   vKid 0   oIA.accName(vKid) "Zusammenstellen und Einfügen 2.0"
    '    i=050   tPt.x = 703   tPt.Y = 254
    '    lResult 0   vKid 1   oIA.accName(vKid) "Alle einfügen"
    '    i=100   tPt.x = 753   tPt.Y = 254
    '    lResult 0   vKid 0   oIA.accName(vKid) "Zusammenstellen und Einfügen 2.0"
    '    i=150   tPt.x = 803   tPt.Y = 254
    '    lResult 0   vKid 2   oIA.accName(vKid) "Alle löschen"
    '    Worked,   :-)
    '
    '  Results from Immediate window when step debug mode from the VBEditor
    
    '    hwndClip 25888836
    '    hwndClip 29427046
    '    hwndClip 460018
    '    hwndScrollBar 656320
    '
    '      tRect1.Top   =  232   tRect2.Top  =  295
    '    ( tRect1.Bottom = 436   tRect2.Bottom = 376 )
    '    Loop i from   0  To  (853-653)=200   Step 50
    '    i=000   tPt.x = 653   tPt.Y = 254
    '    lResult 0   vKid 0   oIA.accName(vKid) "OfficesClipboardViewerTests (Code)"
    '    i=050   tPt.x = 703   tPt.Y = 254
    '    lResult 0   vKid 0   oIA.accName(vKid) "OfficesClipboardViewerTests (Code)"
    '    i=100   tPt.x = 753   tPt.Y = 254
    '    lResult 0   vKid 0   oIA.accName(vKid) "OfficesClipboardViewerTests (Code)"
    '    i=150   tPt.x = 803   tPt.Y = 254
    '    lResult 0   vKid 0   oIA.accName(vKid) "OfficesClipboardViewerTests (Code)"
    '    i=200   tPt.x = 853   tPt.Y = 254
    '    lResult 0   vKid 0   oIA.accName(vKid) "OfficesClipboardViewerTests (Code)"
    '    Unable to clear the Office Clipboard, didn't work,   :-(
    
    ' -------------------------------------------------------------------------------------------------------
    
    
    '  Excel 2003   KB
    '  Results from Immediate window when Run the code, (from Excel or from the VBEditor)
    
    '    hwndClip      4785806
    '    hwndClip 722274
    '    hwndClip 2492028
    '    hwndScrollBar 6096064
    '
    '      tRect1.Top   =  -782   tRect2.Top  =  -719
    '    ( tRect1.Bottom = -73   tRect2.Bottom = -179 )
    '    Loop i from   0  To  (1534-1334)=200   Step 50
    '    i=000   tPt.x = 1334   tPt.Y = -760
    '    lResult 0   vKid 0   oIA.accName(vKid) "Zusammenstellen und Einfügen 2.0"
    '    i=050   tPt.x = 1384   tPt.Y = -760
    '    lResult 0   vKid 1   oIA.accName(vKid) "Alle einfügen"
    '    i=100   tPt.x = 1434   tPt.Y = -760
    '    lResult 0   vKid 0   oIA.accName(vKid) "Zusammenstellen und Einfügen 2.0"
    '    i=150   tPt.x = 1484   tPt.Y = -760
    '    lResult 0   vKid 2   oIA.accName(vKid) "Alle löschen"
    '    Worked,   :-)
    
    
    '  Results from Immediate window when step debug mode from the VBEditor
    '    hwndClip 4785806
    '    hwndClip 722274
    '    hwndClip 2492028
    '    hwndScrollBar 6096064
    '
    '      tRect1.Top   =  -782   tRect2.Top  =  -719
    '    ( tRect1.Bottom = -73   tRect2.Bottom = -179 )
    '    Loop i from   0  To  (1534-1334)=200   Step 50
    '    i=000   tPt.x = 1334   tPt.Y = -760
    '    lResult 0   vKid 0   oIA.accName(vKid) "Direktbereich"
    '    i=050   tPt.x = 1384   tPt.Y = -760
    '    lResult 0   vKid 0   oIA.accName(vKid) "Direktbereich"
    '    i=100   tPt.x = 1434   tPt.Y = -760
    '    lResult 0   vKid 0   oIA.accName(vKid) "Direktbereich"
    '    i=150   tPt.x = 1484   tPt.Y = -760
    '    lResult 0   vKid 0   oIA.accName(vKid) "Direktbereich"
    '    i=200   tPt.x = 1534   tPt.Y = -760
    '    lResult 0   vKid 0   oIA.accName(vKid) "Direktbereich"
    '    Unable to clear the Office Clipboard, didn't work,   :-(
    
    '  Some stuff copied from the spy after dragging into OfficesViewerPane
    '    Caption:     Zusammenstellen und Einfügen 2.0
    '    Class:       bosa_sdm_XL9  (Unicode)
    '    Rectangle:   (1334,-782) - (1534,-73)  -  200x709
    '    Client Rect: (0,0) - (200,709)  -  200x709
    '
    '





    2007

    https://i.postimg.cc/XvKYCMJN/XL-200...ons-on-Run.jpg XL 2007 WinSpy & Dimensions on Run.jpg

    Code:
     ' Excel 2007 Klaus Notebook
    '  Results from Immediate window when Run the code, (from Excel or from the VBEditor)
    '    hwndClip 20579580
    '    hwndClip 29689006
    '    hwndClip 460302
    '    hwndScrollBar 722120
    '
    '      tRect1.Top   =  206   tRect2.Top  =  256
    '    ( tRect1.Bottom = 579   tRect2.Bottom = 541 )
    '    Loop i from   0  To  (231-37)=194   Step 50
    '    i=000   tPt.x = 37   tPt.Y = 221
    '    lResult 0   vKid 0   oIA.accName(vKid) "Collect and Paste 2.0"
    '    i=050   tPt.x = 87   tPt.Y = 221
    '    lResult 0   vKid 1   oIA.accName(vKid) "Paste All"
    '    i=100   tPt.x = 137   tPt.Y = 221
    '    lResult 0   vKid 2   oIA.accName(vKid) "Clear All"
    '    Worked,   :-)
    '
    '  Results from Immediate window when step debug mode from the VBEditor
    '    hwndClip 20579580
    '    hwndClip 29689006
    '    hwndClip 460302
    '    hwndScrollBar 722120
    '
    '      tRect1.Top   =  206   tRect2.Top  =  256
    '    ( tRect1.Bottom = 579   tRect2.Bottom = 541 )
    '    Loop i from   0  To  (231-37)=194   Step 50
    '    i=000   tPt.x = 37   tPt.Y = 221
    '    lResult 0   vKid 0   oIA.accName(vKid) "Collect and Paste 2.0"
    '    i=050   tPt.x = 87   tPt.Y = 221
    '    lResult 0   vKid 1   oIA.accName(vKid) "Paste All"
    '    i=100   tPt.x = 137   tPt.Y = 221
    '    lResult 0   vKid 2   oIA.accName(vKid) "Clear All"
    '    Worked,   :-)
    
    '  Some stuff copied from the spy after dragging into OfficesViewerPane
    '    Caption:     Zusammenstellen und Einfügen 2.0
    '    Class:       bosa_sdm_XL9  (Unicode)
    '    Rectangle:   (37,206) - (231,579)  -  194x373
    '    Client Rect: (0,0) - (194,373)  -  194x373
    
    
    ' -------------------------------------------------------------------------------------------------------
    
    
    '    '  Excel 2007 KB
    '  Results from Immediate window when Run the code, (from Excel or from the VBEditor)
    '      tRect1.Top   =  -711   tRect2.Top  =  -661
    '    ( tRect1.Bottom = -193   tRect2.Bottom = -229 )
    '    Loop i from   0  To  (1434-1207)=227   Step 50
    '    i=000   tPt.x = 1207   tPt.Y = -696
    '    lResult 0   vKid 0   oIA.accName(vKid) "Collect and Paste 2.0"
    '    i=050   tPt.x = 1257   tPt.Y = -696
    '    lResult 0   vKid 1   oIA.accName(vKid) "Paste All"
    '    i=100   tPt.x = 1307   tPt.Y = -696
    '    lResult 0   vKid 2   oIA.accName(vKid) "Clear All"
    '    Worked,   :-)
     
    '  Results from Immediate window when step debug mode from the VBEditor
    '       tRect1.Top   =  -725   tRect2.Top  =  -675
    '    ( tRect1.Bottom = -159   tRect2.Bottom = -195 )
    '    Loop i from   0  To  (1019-792)=227   Step 50
    '    i=000   tPt.x = 792   tPt.Y = -710
    '    lResult 0   vKid 0   oIA.accName(vKid) "Collect and Paste 2.0"
    '    i=050   tPt.x = 842   tPt.Y = -710
    '    lResult 0   vKid 1   oIA.accName(vKid) "Paste All"
    '    i=100   tPt.x = 892   tPt.Y = -710
    '    lResult 0   vKid 2   oIA.accName(vKid) "Clear All"
     '    Worked,   :-)
    
     
    '  Some stuff copied from the spy after dragging into OfficesViewerPane
    '    Caption:     Collect and Paste 2.0
    '    Class:       bosa_sdm_XL9  (Unicode)
    '    Rectangle:   (1207,-711) - (1434,-193)  -  227x518
    '    Client Rect: (0,0) - (227,518)  -  227x518




    2010
    https://i.postimg.cc/023jgdFv/XL-201...ons-on-Run.jpg XL 2010 WinSpy & Dimensions on Run.jpg

    Code:
     ' Excel 2010 Klaus Notebook
    '    hwndClip 329404
    '    hwndClip 329350
    '    hwndClip 394808
    '    hwndScrollBar 329338
    '
    '      tRect1.Top   =  209   tRect2.Top  =  259
    '    ( tRect1.Bottom = 569   tRect2.Bottom = 534 )
    '    Loop i from   0  To  (773-479)=294   Step 50
    '    i=000   tPt.x = 479   tPt.Y = 224
    '    lResult 0   vKid 0   oIA.accName(vKid) "Zusammenstellen und Einfügen 2.0"
    '    i=050   tPt.x = 529   tPt.Y = 224
    '    lResult 0   vKid 1   oIA.accName(vKid) "Alle einfügen"
    '    i=100   tPt.x = 579   tPt.Y = 224
    '    lResult 0   vKid 0   oIA.accName(vKid) "Zusammenstellen und Einfügen 2.0"
    '    i=150   tPt.x = 629   tPt.Y = 224
    '    lResult 0   vKid 2   oIA.accName(vKid) "Alle löschen"
    '    Worked,   :-)
    '
    '  Results from Immediate window when step debug mode from the VBEditor
    '    hwndClip 329404
    '    hwndClip 329350
    '    hwndClip 394808
    '    hwndScrollBar 329338
    '
    '      tRect1.Top   =  209   tRect2.Top  =  259
    '    ( tRect1.Bottom = 569   tRect2.Bottom = 534 )
    '    Loop i from   0  To  (773-479)=294   Step 50
    '    i=000   tPt.x = 479   tPt.Y = 224
    '    lResult 0   vKid 0   oIA.accName(vKid) "Projektfenster"
    '    i=050   tPt.x = 529   tPt.Y = 224
    '    lResult 0   vKid 0   oIA.accName(vKid) "OfficesClipboardViewerTests (Code)"
    '    i=100   tPt.x = 579   tPt.Y = 224
    '    lResult 0   vKid 0   oIA.accName(vKid) "OfficesClipboardViewerTests (Code)"
    '    i=150   tPt.x = 629   tPt.Y = 224
    '    lResult 0   vKid 0   oIA.accName(vKid) "OfficesClipboardViewerTests (Code)"
    '    i=200   tPt.x = 679   tPt.Y = 224
    '    lResult 0   vKid 0   oIA.accName(vKid) "OfficesClipboardViewerTests (Code)"
    '    i=250   tPt.x = 729   tPt.Y = 224
    '    lResult 0   vKid 0   oIA.accName(vKid) "OfficesClipboardViewerTests (Code)"
    '    Unable to clear the Office Clipboard, didn't work,   :-(
    
    
    '  Some stuff copied from the spy after dragging into OfficesViewerPane
    '    Caption:     Zusammenstellen und Einfügen 2.0
    '    Class:       bosa_sdm_XL9  (Unicode)
    '    Rectangle:   (479,209) - (773,569)  -  294x360
    '    Client Rect: (0,0) - (294,360)  -  294x360
    
    ' -------------------------------------------------------------------------------------------------------
    
    
      '    '  Excel 2010 Elfy
    '  Results from Immediate window when Run the code, (from Excel or from the VBEditor)
    '    hwndClip 461200
    '    hwndClip 264628
    '    hwndClip 264678
    '    hwndScrollBar 330140
    
    '      tRect1.Top   =  224   tRect2.Top  =  274
    '    ( tRect1.Bottom = 819   tRect2.Bottom = 778 )
    '    Loop i from   0  To  (808-514)=294   Step 50
    '    i=000   tPt.x = 514   tPt.Y = 239
    '    lResult 0   vKid 0   oIA.accName(vKid) "Zusammenstellen und Einfügen 2.0"
    '    i=050   tPt.x = 564   tPt.Y = 239
    '    lResult 0   vKid 1   oIA.accName(vKid) "Alle einfügen"
    '    i=100   tPt.x = 614   tPt.Y = 239
    '    lResult 0   vKid 0   oIA.accName(vKid) "Zusammenstellen und Einfügen 2.0"
    '    i=150   tPt.x = 664   tPt.Y = 239
    '    lResult 0   vKid 2   oIA.accName(vKid) "Alle löschen"
    '    Worked,   :-)
    
    
    
    
    '  Results from Immediate window when step debug mode from the VBEditor
    '    hwndClip 461200
    '    hwndClip 264628
    '    hwndClip 264678
    '    hwndScrollBar 330140
    '
    '      tRect1.Top   =  224   tRect2.Top  =  274
    '    ( tRect1.Bottom = 819   tRect2.Bottom = 778 )
    '    Loop i from   0  To  (808-514)=294   Step 50
    '    i=000   tPt.x = 514   tPt.Y = 239
    '    lResult 0   vKid 0   oIA.accName(vKid) "OfficesClipboardViewerTests (Code)"
    '    i=050   tPt.x = 564   tPt.Y = 239
    '    lResult 0   vKid 0   oIA.accName(vKid) "OfficesClipboardViewerTests (Code)"
    '    i=100   tPt.x = 614   tPt.Y = 239
    '    lResult 0   vKid 0   oIA.accName(vKid) "OfficesClipboardViewerTests (Code)"
    '    i=150   tPt.x = 664   tPt.Y = 239
    '    lResult 0   vKid 0   oIA.accName(vKid) "OfficesClipboardViewerTests (Code)"
    '    i=200   tPt.x = 714   tPt.Y = 239
    '    lResult 0   vKid 0   oIA.accName(vKid) "OfficesClipboardViewerTests (Code)"
    '    i=250   tPt.x = 764   tPt.Y = 239
    '    lResult 0   vKid 0   oIA.accName(vKid) "OfficesClipboardViewerTests (Code)"
    '    Unable to clear the Office Clipboard, didn't work,   :-(
    
    '  Some stuff copied from the spy after dragging into OfficesViewerPane
    '    Caption:     Zusammenstellen und Einfügen 2.0
    '    Class:       bosa_sdm_XL9  (Unicode)
    '    Rectangle:   (347,205) - (641,800)  -  294x595
    '    Client Rect: (0,0) - (294,595)  -  294x595




    2013
    https://i.postimg.cc/0ywQ9K1w/XL-201...ons-on-Run.jpg XL 2013 WinSpy & Dimensions on Run.jpg


    Code:
     Results from Immediate window 
    
     '      tRect1.Top   =  -327   tRect2.Top  =  -239
    '    ( tRect1.Bottom = 6   tRect2.Bottom = -29 )
    '    Loop i from   0  To  (2174-1990)=184   Step 50
    '    i=000   tPt.x = 1990   tPt.Y = -293
    '    lResult 0   vKid 0   oIA.accName(vKid) "Zusammenstellen und Einfügen 2.0"
    '    i=050   tPt.x = 2040   tPt.Y = -293
    '    lResult 0   vKid 2   oIA.accName(vKid) "Alle löschen"
    '    Worked,   :-)
    
    Some stuff copied from the spy after dragging into OfficesViewerPane
    '    Caption:     Zusammenstellen und Einfügen 2.0
    '    Class:       bosa_sdm_XL9  (Unicode)
    '    Rectangle:   (1990,-327) - (2174,136)  -  184x463
    '    Client Rect: (0,0) - (184,463)  -  184x463

    Last edited by DocAElstein; 11-08-2024 at 10:15 PM.

  8. #178
    Fuhrer, Vierte Reich DocAElstein's Avatar
    Join Date
    Aug 2014
    Posts
    9,458
    Rep Power
    10

    Results for Excel 2016

    Compared to the results for Offices 2003 2007 2010 and 2013 in the previous post, the results here for Office 2016 look a bit screwy.


    https://i.postimg.cc/Y2djRwxh/XL-201...ons-on-Run.jpg



    Results from Immediate window when Run the code, (from Excel or from the VBEditor)
    Code:
     '    Running the coding:-
    '    hwndClip 939260
    '    hwndClip 676872
    '    hwndClip 1003964
    '    hwndScrollBar 610674
    '
    '      tRect1.Top   =  489   tRect2.Top  =  489
    '    ( tRect1.Bottom = 1064   tRect2.Bottom = 1064 )
    '    Loop i from   0  To  (989-733)=256   Step 50
    '    i=000   tPt.x = 733   tPt.Y = 479
    '    lResult 0   vKid 0   oIA.accName(vKid) ""
    '    i=050   tPt.x = 783   tPt.Y = 479
    '    lResult 0   vKid 0   oIA.accName(vKid) ""
    '    i=100   tPt.x = 833   tPt.Y = 479
    '    lResult 0   vKid 0   oIA.accName(vKid) ""
    '    i=150   tPt.x = 883   tPt.Y = 479
    '    lResult 0   vKid 0   oIA.accName(vKid) ""
    '    i=200   tPt.x = 933   tPt.Y = 479
    '    lResult 0   vKid 0   oIA.accName(vKid) "Optionen für den Aufgabenbereich"
    '    i=250   tPt.x = 983   tPt.Y = 479
    '    lResult 0   vKid 0   oIA.accName(vKid) ""
    '    Unable to clear the Office Clipboard, didn't work,   :-(
    Results from Immediate window when step debug mode from the VBEditor
    Code:
     '  Doing the coding in step debug mode
    '    hwndClip 939260
    '    hwndClip 676872
    '    hwndClip 1003964
    '    hwndScrollBar 610674
    '
    '      tRect1.Top   =  489   tRect2.Top  =  489
    '    ( tRect1.Bottom = 1064   tRect2.Bottom = 1064 )
    '    Loop i from   0  To  (989-733)=256   Step 50
    '    i=000   tPt.x = 733   tPt.Y = 479
    '    lResult 0   vKid 0   oIA.accName(vKid) "OfficesClipboardViewerTests (Code)"
    '    i=050   tPt.x = 783   tPt.Y = 479
    '    lResult 0   vKid 0   oIA.accName(vKid) "OfficesClipboardViewerTests (Code)"
    '    i=100   tPt.x = 833   tPt.Y = 479
    '    lResult 0   vKid 0   oIA.accName(vKid) "OfficesClipboardViewerTests (Code)"
    '    i=150   tPt.x = 883   tPt.Y = 479
    '    lResult 0   vKid 0   oIA.accName(vKid) "OfficesClipboardViewerTests (Code)"
    '    i=200   tPt.x = 933   tPt.Y = 479
    '    lResult 0   vKid 0   oIA.accName(vKid) "Direktbereich"
    '    i=250   tPt.x = 983   tPt.Y = 479
    '    lResult 0   vKid 0   oIA.accName(vKid) "Direktbereich"
    '    Unable to clear the Office Clipboard, didn't work,   :-(
    '
     


    Some stuff copied from the spy after dragging into OfficesViewerPane
    Code:
     '    Caption:        NO Caption!!!
    '    Class:       NetUIHWND  (Unicode)
    '    Rectangle:   (740,361) - (996,936)  -  256x575
    '                 (733,489) - (989,1064)  -  256x575
    '    Client Rect: (0,0) - (256,575)  -  256x575
    '
    Last edited by DocAElstein; 11-08-2024 at 10:13 PM.

  9. #179
    Fuhrer, Vierte Reich DocAElstein's Avatar
    Join Date
    Aug 2014
    Posts
    9,458
    Rep Power
    10
    Some tests on the small codings

    Some simple test based on this modified coding:
    Code:
    Sub small_20202024_ClearOfficeClipBoard_Tests()  '  https://www.excelfox.com/forum/showthread.php/2824-Tests-Copying-pasting-Cliipboard-issues-and-otes-on-API-stuff?p=18044&viewfull=1#post18044
    
    Dim avAcc, bClipboard As Boolean, j As Long, x As Long
    Dim MyPain As String
        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      '   bClipboard will be false if the viewer pain is not open
        If Not bClipboard Then
         avAcc.Visible = True           '   This opens the Viewer pain. The coding won't work if it is not open
         DoEvents: DoEvents
        Else
        End If
    '   coding change for Office versions at  --  Office 2016  ==
        If CLng(Val(Application.Version)) < 16 Then
    ' --For Office versions 2003 2007 2010 2013 ----------------------------------------
            For j = 1 To 4         '      J =    1  2  3  4
             AccessibleChildren avAcc, Choose(j, 0, 3, 0, 3), 1, avAcc, 1
             Debug.Print "j " & j & "     ";
             Debug.Print "0&" & " " & avAcc.accName(CLng(0));
             On Error Resume Next
             Debug.Print "   1&" & " " & avAcc.accName(CLng(1));
             Debug.Print "   2&" & " " & avAcc.accName(CLng(2));
             Debug.Print "   3&" & " " & avAcc.accName(CLng(3));
             Debug.Print "   4&" & " " & avAcc.accName(CLng(4));
             Debug.Print "   5&" & " " & avAcc.accName(CLng(5));
             Debug.Print "   6&" & " " & avAcc.accName(CLng(6));
             Debug.Print "   7&" & " " & avAcc.accName(CLng(7));
             Debug.Print "   8&" & " " & avAcc.accName(CLng(8));
             Debug.Print "   9&" & " " & avAcc.accName(CLng(9))
             On Error GoTo 0
             Debug.Print
            Next
         avAcc.accDoDefaultAction 2&  '           This seems to do the clearing   It will NOT error if viewer pain is already  Cleared                  1& for paste
    ' ----------------------------------------------------------------------------------
        Else
    ' ==For Office versions 2016 and higher ==============================================
            For j = 1 To 7      '           J =  1  2  3  4  5  6  7
             AccessibleChildren avAcc, Choose(j, 0, 3, 0, 3, 0, 3, 1), 1, avAcc, 1
             Debug.Print "j " & j & "     ";
             Debug.Print "0&" & " " & avAcc.accName(CLng(0));
             On Error Resume Next
             Debug.Print "   1&" & " " & avAcc.accName(CLng(1));
             Debug.Print "   2&" & " " & avAcc.accName(CLng(2));
             Debug.Print "   3&" & " " & avAcc.accName(CLng(3));
             Debug.Print "   4&" & " " & avAcc.accName(CLng(4));
             Debug.Print "   5&" & " " & avAcc.accName(CLng(5));
             Debug.Print "   6&" & " " & avAcc.accName(CLng(6));
             Debug.Print "   7&" & " " & avAcc.accName(CLng(7));
             Debug.Print "   8&" & " " & avAcc.accName(CLng(8));
             Debug.Print "   9&" & " " & avAcc.accName(CLng(9))
             On Error GoTo 0
             Debug.Print
            Next
         avAcc.accDoDefaultAction 0& '            This seems to do the clearing   It WILL error if viewer pain is already  Cleared
        End If ' =======================================================================
     Let Application.CommandBars(MyPain).Visible = bClipboard      '   Puts the viewer pain back as it was, open or closed
    End Sub
    
    The results for the small codings are more consistent, and there is no strange problem of different results when done in step debug mode
    Here some results for Offices 2003 2007 2010 2013
    Code:
     '  excel 2003 KB
    ' Run
    '    j 1     0& 1 von 24 - Zwischenablage
    '    j 2     0& 1 von 24 - Zwischenablage
    '    j 3     0& Zusammenstellen und Einfügen 2.0
    '    j 4     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
    '  debug step from VBEditor
    '    j 1     0& Zwischenablage
    '    j 2     0& Zwischenablage
    '    j 3     0& Zusammenstellen und Einfügen 2.0
    '    j 4     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
    
    
    
    ' =============================================================================================
    
    '  Excel 2007 KB
    '  Run
    '    j 1     0& Clipboard
    '    j 2     0& Clipboard
    '    j 3     0& Collect and Paste 2.0
    '    j 4     0& Collect and Paste 2.0   1& Paste All   2& Clear All   3& Click an item to paste:   4& Clipboard   5& Clipboard   6& Options
    '
    '  Debug step from VBEditor
    '    j 1     0& Clipboard
    '    j 2     0& Clipboard
    '    j 3     0& Collect and Paste 2.0
    '    j 4     0& Collect and Paste 2.0   1& Paste All   2& Clear All   3& Click an item to paste:   4& Clipboard   5& Clipboard   6& Options
        '
    
    
    
    
    '  ======================================================================================================000
    
    '   2010  Elfy
    '  Run
    '    j 1     0& 1 von 24 - Zwischenablage
    '    j 2     0& 1 von 24 - Zwischenablage
    '    j 3     0& Zusammenstellen und Einfügen 2.0
    '    j 4     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
    '
    '  step debug
    '    j 1     0& Zwischenablage
    '    j 2     0& Zwischenablage
    '    j 3     0& Zusammenstellen und Einfügen 2.0
    '    j 4     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
    
    
    '  ====================================================================================================
    
    '   2013 SerSzuD2
    '  Run
    '    j 1     0& Zwischenablage
    '    j 2     0& Zwischenablage
    '    j 3     0& Zusammenstellen und Einfügen 2.0
    '    j 4     0& Zusammenstellen und Einfügen 2.0   1& Alle einfügen   2& Alle löschen   3& Klicken Sie auf ein Element, um es einzufügen:   4& Zwischenablage   5& Zwischenablage   6& Optionen
    '
    '  step debug
    '    j 1     0& Zwischenablage
    '    j 2     0& Zwischenablage
    '    j 3     0& Zusammenstellen und Einfügen 2.0
    '    j 4     0& Zusammenstellen und Einfügen 2.0   1& Alle einfügen   2& Alle löschen   3& Klicken Sie auf ein Element, um es einzufügen:   4& Zwischenablage   5& Zwischenablage   6& Optionen
    Here the corresponding result for a Office 2016
    Code:
     ' Excel 2016 Torrox
    '  Run
    '    j 1     0& Zwischenablage
    '    j 2     0& Zwischenablage
    '    j 3     0&
    '    j 4     0&
    '    j 5     0& Zwischenablage
    '    j 6     0& Zwischenablage
    '    j 7     0& Alle löschen
    '
    '  Debug step
    '    j 1     0& Zwischenablage
    '    j 2     0& Zwischenablage
    '    j 3     0&
    '    j 4     0&
    '    j 5     0& Zwischenablage
    '    j 6     0& Zwischenablage
    '    j 7     0& Alle löschen
    Last edited by DocAElstein; 11-09-2024 at 01:50 AM.

  10. #180
    Fuhrer, Vierte Reich DocAElstein's Avatar
    Join Date
    Aug 2014
    Posts
    9,458
    Rep Power
    10
    yvmccnvm
    Last edited by DocAElstein; 10-29-2024 at 04:04 PM.

Similar Threads

  1. Replies: 114
    Last Post: 03-04-2024, 02:39 PM
  2. Replies: 42
    Last Post: 05-29-2023, 01:19 PM
  3. Replies: 11
    Last Post: 10-13-2013, 10:53 PM
  4. Replies: 7
    Last Post: 08-28-2013, 12:57 AM
  5. Declaring API Functions In 64 Bit
    By marreco in forum Excel Help
    Replies: 2
    Last Post: 02-11-2013, 03:18 AM

Posting Permissions

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