text on clipboard not complete

Are there any limitations on clipboards length?
I try to send quite a long text to the clipboard but obviously there arives only a small part of it.

Dim c As New Clipboard
msgbox str(len(strGesamtText)) 'gives 211000
c.SetText(strGesamtText)
msgbox str(Len(c.Text)) 'gives 3370
c.Close

The same I get when I try c.text = strGesamtText
What can I do?

Mac or Windows ?

Also, at first glance, 206 Kilobytes seems indeed extremely big for a clipboard. In such instance, Microsoft Word or Excel would display a warning message. If possible, this should rather be addressed through a disk file.

of course, it’s a lot. I want to export the contents of a database table to excel via my own macro in xojo and I was looking for a more elegant way than saving the contents to a file atfirst.
Maybe there is a way to send the data in serveral portions.

I assume Windows because this works fine here on OS X (with 3MB text in a TextArea):

[code] system.debuglog(TextArea1.Text.Len.ToText)

Dim c As New Clipboard
c.Text = TextArea1.Text
system.debuglog(c.Text.Len.ToText)

TextArea1.Text = c.Text
system.debuglog(TextArea1.Text.Len.ToText)
c.Close[/code]
I don’t know the difference but it also works with ok c.SetText

edit: if this is indeed a windows limitation, I think using a temp file is more easy instead of chopping it up in several portions.

text encoding?
Did you check on what bytes your text has?
could be cut on the first chr(0) character.

[quote=266523:@Christian Hahn]of course, it’s a lot. I want to export the contents of a database table to excel via my own macro in xojo and I was looking for a more elegant way than saving the contents to a file atfirst.
Maybe there is a way to send the data in serveral portions.[/quote]

The problem could very well be on the Excel side.

Hy, Christian, that’s a good idea. I’ll check this, tomorrow.
I’ll refer to that.

tried on windows (7 & 10) with 2MB text file, 20MB text file and 40MB text file - no problems

text file did not have any special encoding

[quote=266530:@Christian Schmitz]text encoding?
Did you check on what bytes your text has?
could be cut on the first chr(0) character.[/quote]
That’s it, Christian got it. It’s the first chr(0) that cuts the data when sent to clipboard.
I always tried to avoid the appearance of chr(0) when retrieving empty database fields in a datagrid but sometimes one strumbles upon those phenomena.
Thank you very much.

Great! :slight_smile: