+ Reply to Thread
Results 1 to 6 of 6

DataObject/Clipboard coming out with strange characters

  1. #1
    Valued Forum Contributor quekbc's Avatar
    Join Date
    01-18-2010
    Location
    Sydney, Australia
    MS-Off Ver
    2010, 2013, 2016
    Posts
    1,149

    DataObject/Clipboard coming out with strange characters

    Hey guys, hope you guys can shed some light on some issue I've been facing.

    I have this simple code here:
    Please Login or Register  to view this content.
    This code has been working fine for me until fairly recently, but I don't know what's causing the issue.

    The problem I've been having is that, whenever I push stuff into clipboard (i.e. run the macro ExcelForumTest) - when I paste it (CTRL V), it spits out 2 odd characters ASCII code 63 or square boxes in Excel, question marks when pasted in VBE, nothing in Notepad.

    When I try to analyse via VBA using the "ExtractFromClipboard" macro, I am faced with the same issue.

    My current system:
    Windows 10 Pro
    Intel Core i7
    8.00 GB RAM
    64-bit Operating System
    Problem persists in all Excel 2007, 2010, and 2013 (32-bit).


    I've repaired Excel once - which worked for maybe 5 minutes, then it reverted to the strange characters again.

    Happy to hear any insights anyone here might have.

  2. #2
    Forum Expert dominicb's Avatar
    Join Date
    01-25-2005
    Location
    Lancashire, England
    MS-Off Ver
    MS Office 2000, 2003, 2007 & 2016 365
    Posts
    4,867

    Re: DataObject/Clipboard coming out with strange characters

    Good afternoon quekbc

    Hmmmm, sure is strange. I wasn't going to answer this, as I don't have a solution, but nobody else has responded, it's 6 hours old, so I'll offer my thoughts, some encouraging words ... but no answer.

    I've tested this and it works OK on my system - you forgot to mention to other users that you need to set a reference to the Microsoft Forms 2.0 Object Library. My system is Excel 13, Windows 7 - both 32 bit.

    I suspect that Windows is the issue, as the Clipboard, as you're no doubt aware, is a Windows object not an Excel (or VBA) object. This would be borne out by the fact that you have tried several different version of Excel which all react the same - it just doesn't seem right that after running Excel repair it works OK, however briefly that may be.

    In your project do you "have" to utilise the clipboard? Can you not just store the values / strings as variables and populate fields that way?

    DominicB

  3. #3
    Valued Forum Contributor quekbc's Avatar
    Join Date
    01-18-2010
    Location
    Sydney, Australia
    MS-Off Ver
    2010, 2013, 2016
    Posts
    1,149

    Re: DataObject/Clipboard coming out with strange characters

    Thanks for the response DominicB.

    Yes, you are right, I did forget to mention the need to add Forms 2.0 reference to VBE. My bad.

    I suspected as much, but thought I'd ask here in case someone else faced the same issue and perhaps have a solution.

    I don't technically "have" to utilise the clipboard - but it is useful in my field of work. I constantly work with multiple instances of Excel and having this code helps me transfer information across instances of Excel.

    Thanks again for the response. I shall have to find a way to work around this.

  4. #4
    Forum Expert shg's Avatar
    Join Date
    06-20-2007
    Location
    The Great State of Texas
    MS-Off Ver
    2010, 2019
    Posts
    40,689

    Re: DataObject/Clipboard coming out with strange characters

    Rattling around in my brain is that this is a recent (W8?) issue with the clipboard, and romperstomper knows of a workaround. I'll ask if he will grace us with his presence.
    Last edited by shg; 11-25-2015 at 06:25 PM.
    Entia non sunt multiplicanda sine necessitate

  5. #5
    Forum Guru Izandol's Avatar
    Join Date
    03-29-2012
    Location
    *
    MS-Off Ver
    Excel 20(03|10|13)
    Posts
    2,581

    Re: DataObject/Clipboard coming out with strange characters

    It is bug from Windows 8 on. It is better to use Clipboard API - please read answer with links on MSDN forum: https://social.msdn.microsoft.com/Fo...d?forum=isvvba
    • Please remember to mark threads Solved with Thread Tools link at top of page.
    • Please use code tags when posting code: [code]Place your code here[/code]
    • Please read Forum Rules

  6. #6
    Valued Forum Contributor quekbc's Avatar
    Join Date
    01-18-2010
    Location
    Sydney, Australia
    MS-Off Ver
    2010, 2013, 2016
    Posts
    1,149

    Re: DataObject/Clipboard coming out with strange characters

    Thanks Izandol! Seems like I'm not the only one with that issue.

    I'll have a look at using the clipboard API

+ 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. A strange Clipboard problem
    By keymuu in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 12-15-2012, 04:31 AM
  2. Mail merge from excel - weird characters coming up...
    By jen2412 in forum Word Formatting & General
    Replies: 4
    Last Post: 08-01-2012, 06:33 PM
  3. Strange behaviour - loading Excel clears Clipboard
    By Trevor Shuttleworth in forum Excel General
    Replies: 1
    Last Post: 08-19-2006, 05:10 PM
  4. [SOLVED] Strange Clipboard Problem
    By I Robert in forum Excel General
    Replies: 0
    Last Post: 08-16-2006, 12:20 PM
  5. [SOLVED] Copying more than 255 Characters to the Clipboard
    By biker in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 07-12-2006, 09:10 AM
  6. Copying more than 255 Characters to the Clipboard
    By biker in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 07-12-2006, 04:10 AM
  7. [SOLVED] Copying more than 255 Characters to the Clipboard
    By biker in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 07-12-2006, 04:05 AM
  8. Strange Characters in Cell
    By Jack Gillis in forum Excel General
    Replies: 0
    Last Post: 07-06-2006, 04:25 PM

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