Clipboard VBA works in W7 not in W10

Avogadro

Board Regular
Joined
Apr 29, 2010
Messages
59
The three subs below work fine in windows 7, unfortunatelyI upgraded to windows 10 a few days ago and now it will not work. I get ?? when I paste. Anyone know how I can fix this.

HTML:
Sub Invoicenumber()
PlayTheSound "Speech Disambiguation.wav"
Dim clipboard As MSForms.DataObject
 
Dim str1 As String
Set clipboard = New MSForms.DataObject
 
str1 = Cells(6, 16).Value
clipboard.SetText str1
clipboard.PutInClipboard
End Sub

HTML:
Sub GetTracking()
Dim INVT As Workbook
Dim Invoice As Worksheet
Set INVT = Workbooks("Invoice Template.xlsm")
Set Invoice = INVT.Sheets("Invoice")
Invoice.Activate
Dim clipboard As New MSForms.DataObject
Dim str1 As String
Set clipboard = New MSForms.DataObject
    
str1 = Cells(7, 24).Value
    
clipboard.SetText str1
clipboard.PutInClipboard
Set MSForms_DataObject = Nothing
End Sub

HTML:
Sub URLS()
PlayTheSound "Speech Disambiguation.wav"
Dim str1, str2, str3, str4, str5, str6, str7 As String
Dim clipboard As MSForms.DataObject
Set clipboard = New MSForms.DataObject
str1 = "http://trkcnfrm1.smi.usps.com/PTSInternetWeb/InterLabelInquiry.do?strOrigTrackNum="
str2 = Cells(7, 24).Value
str3 = "&Go+to+Track+%26+Confirm.x=9&Go+to+Track+%26+Confirm.y=6"
str4 = str1 & str2 & str3
str5 = Cells(45, 6).Value
str6 = "http://wwwapps.ups.com/WebTracking/track?track=yes&trackNums="
str7 = str6 & str2
If InStr(str5, "USPS") = 1 Then
clipboard.SetText str4
clipboard.PutInClipboard
Else
clipboard.SetText str7
clipboard.PutInClipboard
End If
End Sub
 

Excel Facts

How to total the visible cells?
From the first blank cell below a filtered data set, press Alt+=. Instead of SUM, you will get SUBTOTAL(9,)
I modified the code as below and it copies to the clipboard but I cant get it to paste.

Code:
Sub Invoicenumber2()

Dim MSForms_DataObject As Object
Dim str1 As String
Set MSForms_DataObject = CreateObject("new:{1C3B4210-F441-11CE-B9EA-00AA006B1A69}")
 
str1 = Cells(6, 16).Value
 MSForms_DataObject.SetText str1
 MSForms_DataObject.PutInClipboard
 Set MSForms_DataObject = Nothing
  
End Sub
 
Upvote 0
Ive been looking around at this and it is not uncommon. some people seem to have resolved the issue by removing Skypes click to call add in which seems odd.

Sorry I cant help. Good luck
 
Upvote 0

Forum statistics

Threads
1,224,823
Messages
6,181,178
Members
453,021
Latest member
Justyna P

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