PutInClipboard not working for some users (getting Windows logo when Ctrl +V)

netuser

Active Member
Joined
Jun 19, 2015
Messages
420
Hi,

I am using this simple code to put data in clipboard that will be used late in another application (Ctrl + V) to paste data.

But for some user it dos'nt work 100% the time, there are days it works there are other days it wont. I dont understand why. I searched on google and saw some people had similar issue but haven't found any solution.

Is there anyway to fix it or is there another method that is more reliable to put data in Clipboard ?



Thanks,

Code:
    Msg =  Range("E3").Value

    Dim DataObj As New MSForms.DataObject
    DataObj.SetText Msg
    DataObj.PutInClipboard

Also tried thsi with same issue:

Code:
    Dim MSForms_DataObject As Object
    Set MSForms_DataObject = CreateObject("new:{1C3B4210-F441-11CE-B9EA-00AA006B1A69}")
    MSForms_DataObject.SetText Msg
    MSForms_DataObject.PutInClipboard
    Set MSForms_DataObject = Nothing
 

Excel Facts

Excel Can Read to You
Customize Quick Access Toolbar. From All Commands, add Speak Cells or Speak Cells on Enter to QAT. Select cells. Press Speak Cells.
It occurs when you have Explorer windows open, I believe. Using the Windows API instead is reliable. See here for example.
 
Last edited:
Upvote 0
Never thought it could be that. I just tested and when explorer was closed it worked. I will check API version for more reliability.

Thanks so much :)
 
Upvote 0

Forum statistics

Threads
1,223,239
Messages
6,170,947
Members
452,368
Latest member
jayp2104

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top