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

    Dec 2022 https://www.eileenslounge.com/viewto...301534#p301534 2 Clipboard Trim Eval Range
    https://www.eileenslounge.com/viewto...301761#p301761 2 Hans knatsch

    Feb 2023 https://www.eileenslounge.com/viewto...304976#p304976 2 Do While Clipboard Gather unique values in one row for each unique key

    May 2023 https://www.eileenslounge.com/viewto...307826#p307826 2 clipboard ramble

    Jan 2023 https://www.eileenslounge.com/viewto...303007#p303007 2 Clipboard opps a vbCr & vbLf OopsAvbCr&vbLf.xls
    Jan 2023 https://www.eileenslounge.com/viewto...303039#p303039 2
    The .Copy method puts a copy of the object you are referencing onto the clipboard, in this case a Range.- and then synthesizes all the supported formats. including the Text format (which it does as the synthesized CF_TEXT format , which always ends CR LF [in fact it is even more clever than that, in that it actually separates Rows with CR LF and columns by Tab])
    The DataObject's .SetText method exposed to VBA, on the other hand, expects a straightforward text string
    The .Copy is going to tell the Clipboard that it …. ( it being VBA I think in this case, or possibly Excel as the controlling/"owning thing") …. this it is in charge of the clipboard for the time being. This it is a deferred render entry thing, but if and when it does actually put stuff in The ( Microsoft Windows ) Clipboard, then in the case of a range it is gonna be quite a few formats, (maybe about 30 ) or maybe not?: I mean, as its a deferred render entry thing it might decide to put different things in The ( Microsoft Windows ) Clipboard depending on what is done later to trigger the thing to do what it is deferring doing when it’s the controlling/ "owning thing" ?
    So that is maybe something close to what the .Copy is doing.
    .SetText and .PutInClipboard
    ( I am not sure if this is a deferred entry thing or not ? ).
    This can’t do anything much other than put text somewhere since that is all you give it: You give it a simple text string. That’s it.
    _.___________________________________________I am not 100% sure what you are saying by your reference synthesized CF_TEXT format.
    This is my guess as to what you are saying. :
    If I use the .GetFromClipboard and .GetText() from within VBA, then what I get will depend on what was the controlling "owning" thing of the The ( Microsoft Windows ) Clipboard at the time ….
    Let me consider the 2 cases relevant here…
    _ case1
    If .Copy was the owning controlling thing of The ( Microsoft Windows ) Clipboard, then, when it sees the request of .GetFromClipboard from within VBA, it may not quite have the format requested. ….I am trying to understand that link you gave ….. I will take a guess that what is going on in this case1 is this:
    It takes one of the formats on the first column from that link you gave which it does have* (*or will have – its deferred entry ....) . It than either makes one of the formats on the second column from that link, or maybe makes one that is not listed there. I don’t know. I do know, and agree with this bit that you said…. it actually separates Rows with CR LF and columns by Tab…..
    _ case2
    If the DataObject is the owning controlling thing of The ( Microsoft Windows ) Clipboard, ( in other words you did the .SetText and .PutInClipboard thing to put text in The ( Microsoft Windows ) Clipboard) , then …..you put a text in and you will get with the .GetFromClipboard and .GetText() the same text back. Simple as that. ( I am still not sure what of the CF_ things are used though in this case either )











    Clsid
    https://eileenslounge.com/viewtopic....314950#p314950 Mike GUID list CLSIDs skids SCIDs
    https://eileenslounge.com/viewtopic....289020#p289020 2 GUIDS CLSIDs in the { } as in CreateObject("New:" & “{aksjjfhaskj}” & "") Oct 2021
    https://eileenslounge.com/viewtopic....286708#p286708 3 CLSID .NET 3.5
    https://eileenslounge.com/viewtopic....289020#p289020 2 clsid Oct 2021 Feb 2016
    https://chandoo.org/forum/threads/cl...6/#post-223256



    API alternative
    2012 Looks like first report of it https://web.archive.org/web/20200806...d?forum=isvvba
    opened a support case with Microsoft as suggested by Kirk Beller…..MS determined the cause to be 'most likely a flaw in our product'. So far, I have had no notification of when or if it might be fixed - MS helped me develop a robust workaround using native Windows API calls instead of a DataObject. These are documented in the following articles:
    > http://msdn.microsoft.com/en-us/libr.../ff192913.aspx (How to: Send Information to the Clipboard); - Cant find on archive, but the original gets redirected to a new one from 2022, archived at similar date https://web.archive.org/web/20240421...-the-clipboard
    > http://msdn.microsoft.com/en-us/libr.../ff194373.aspx (How to: Retrieve Information from the Clipboard). – original archived
    2013 https://web.archive.org/web/20130113.../ff194373.aspx The original gets redirected to one from 2022 , archived at a similar date https://web.archive.org/web/20221203...-the-clipboard
    So far no MS article does the 64bit even though the original article has a post 2019 telling about it
    2015 https://www.spreadsheet1.com/how-to-...xcel-vba.html# VBA does not offer a clipboard object, although Visual Basic 6 did. …. copies just two questions marks to the clipboard when used under Windows 8 and 10 (as tested in September 2015)
    2015 https://wellsr.com/vba/2015/tutorial...d-paste-clear/ Mac as well like Rory’s 2018 Update: With the rollout of Windows 8 and Windows 10, this solution no longer works reliably,
    2018 https://web.archive.org/web/20191220...-the-clipboard difference between the DataObject and the Clipboard
    2018 https://chandoo.org/forum/threads/cl...6/#post-223256 Masterbasdor API Post
    Mar 2019 My last post is best, https://eileenslounge.com/viewtopic....247809#p247809 , giving further links
    Rory’s Tools https://eileenslounge.com/viewtopic....246708#p246708









    Last edited by DocAElstein; 04-25-2024 at 05:03 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
  •