+ Reply to Thread
Results 1 to 5 of 5

Using the Clipboard

  1. #1
    Registered User
    Join Date
    07-12-2010
    Location
    North Ayrshire uk
    MS-Off Ver
    Excel 2016
    Posts
    9

    Using the Clipboard

    I have seen similar threads but not found an answer (assume I got something wrong)

    I use the very simple example below:
    Please Login or Register  to view this content.
    When I run the code I see the contents of the active cell are now in the variable S2 - i.e. seems to be in the clipboard
    After execution there doesn't appear to be anything in the Clipboard. I get 2 small rectangles when I do a ctrl v and there is nothing to PASTE in the Clipboard section of the HOME tab.

    Any help appreciated

  2. #2
    Forum Guru xladept's Avatar
    Join Date
    04-14-2012
    Location
    Pasadena, California
    MS-Off Ver
    Excel 2003,2010
    Posts
    12,378

    Re: Using the Clipboard

    That didn't happen to me. The program put the value in the clipboard and I could paste it anywhere, although successive pastes would erase previous pastes
    If I've helped you, please consider adding to my reputation - just click on the liitle star at the left.

    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~(Pride has no aftertaste.)

    You can't do one thing. XLAdept

    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~aka Orrin

  3. #3
    Forum Expert rorya's Avatar
    Join Date
    08-13-2008
    Location
    UK
    MS-Off Ver
    2016 primarily
    Posts
    4,453

    Re: Using the Clipboard

    It's a bug in the dataobject in Windows8 or later. It happens if you have any File Explorer windows open while running the code. It's safer to use Windows API calls to access the clipboard. A search of this (or other) forum will find many threads on this topic.
    Rory
    Yea though I walk through the valley of the shadow of death, at least it's a change of scenery

  4. #4
    Forum Contributor
    Join Date
    07-23-2018
    Location
    UK
    MS-Off Ver
    365 32bit
    Posts
    166

    Re: Using the Clipboard

    Yes, what took a few lines now take a whole lot more.

    I found this was helpful
    https://www.thespreadsheetguru.com/b...-the-clipboard

  5. #5
    Forum Expert rorya's Avatar
    Join Date
    08-13-2008
    Location
    UK
    MS-Off Ver
    2016 primarily
    Posts
    4,453

    Re: Using the Clipboard

    Just be aware that the code in that link is not correct, and will likely not work on 64bit Office.

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Replies: 2
    Last Post: 05-12-2016, 02:28 AM
  2. Replies: 0
    Last Post: 02-06-2013, 01:55 PM
  3. Replies: 0
    Last Post: 11-19-2012, 09:28 AM
  4. Replies: 0
    Last Post: 11-15-2012, 11:40 AM
  5. Protect clipboard data from other programs trying to use clipboard at same time?
    By chuckchuckit in forum Excel Programming / VBA / Macros
    Replies: 28
    Last Post: 09-25-2010, 07:25 AM
  6. [SOLVED] Store clipboard before "vba do cut&paste" then recover stored information to clipboard?
    By Marie J-son in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 02-08-2006, 02:00 AM
  7. ClearContents or ClearFormats also clears Clipboard. How can I keep the clipboard?
    By rlaemmler@gmail.com in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 12-15-2005, 11:35 PM

Tags for this Thread

Bookmarks

Posting Permissions

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

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1