ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   putInClipboard errors on mac (https://www.excelbanter.com/excel-programming/282307-putinclipboard-errors-mac.html)

subra

putInClipboard errors on mac
 
putInClipboard method of the DataObject is putting some invisible
characters on clipboard at the end of the string. I can see these
characters when i paste the clipboard conetents in BBedit. This
happens only on Mac (OSX). I don't have any problem on windows. I
figured out that for every character in the string one invisible
character is added at the end plus two ( if i have 10 character
string, there are 12 invisible characters). Also when I use GetText I
don't get anything. Following is my test code. I appreciate any
suggestions.

Dim data As DataObject
Dim text, rs As String

For i = 1 To 100 Step 1
text = text & "hello"
Next

Set data = New DataObject
data.SetText text
data.PutInClipboard

data.GetFromClipboard
rs = data.GetText
' no text in my immediate window
Debug.Print rs


All times are GMT +1. The time now is 04:31 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com