PC Review


Reply
Thread Tools Rate Thread

Copy from clipboard in excel/vba: size limit ?

 
 
Cyril
Guest
Posts: n/a
 
      13th Apr 2007

I am looking to copy from clipboard in a vba string and I am having
trouble doing this: I have used several code sample such as :
http://www.cpearson.com/excel/clipboar.htm and
http://www.vba-programmer.com/Snippe...Using_API.html

but they all give the same result, that is the pasted text is cut in
the middle.

I am trying to paste the text:
"Regions List: 0060aam3.wav

Name In Out Duration
-------------------------- ------------- ------------- -------------
VOICE 00:00:00.012 00:00:00.638 00:00:00.626
VOICE 00:00:00.712 00:00:00.884 00:00:00.172
07 00:00:00.150 00:00:00.389 00:00:00.239
VOICE 00:00:00.251 00:00:00.328 00:00:00.077
10 00:00:00.464 00:00:00.537 00:00:00.073
VOICE 00:00:00.746 00:00:00.860 00:00:00.114"

Using the code :
Dim myVar As Variant
Dim MyDataObj As New DataObject

MyDataObj.GetFromClipboard
myVar = MyDataObj.GetText()

But the myVar variable is set to
"Regions List: 0060aam3.wav

Name In Out Duration
-------------------------- ------------- ------------- -------------
VOICE 00:00:00.012 00:00:00.638 00:00:00.626
VOICE " after this instruction.

I haved searched in google but not seen any limitation on string size.
I have tried to empty clipboard or call again getText but this doesn't
work either.

Have anyone ever experienced this ?
Any idea ?

Thanks for your feedback,

Cyril

 
Reply With Quote
 
 
 
 
NickHK
Guest
Posts: n/a
 
      16th Apr 2007
Cyril,
You code works for me. Maybe it is the copying stage that is not acting as
expected ?

Also, I would add a check to make sure there is something in the correct
format to copy first:

Const TEXTFORMAT As Long = 1

MyDataObj.GetFromClipboard

If MyDataObj.GetFormat(TEXTFORMAT) Then
myVar = MyDataObj.GetText()
End If

NickHK

"Cyril" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
>
> I am looking to copy from clipboard in a vba string and I am having
> trouble doing this: I have used several code sample such as :
> http://www.cpearson.com/excel/clipboar.htm and
>

http://www.vba-programmer.com/Snippe...Using_API.html
>
> but they all give the same result, that is the pasted text is cut in
> the middle.
>
> I am trying to paste the text:
> "Regions List: 0060aam3.wav
>
> Name In Out Duration
> -------------------------- ------------- ------------- -------------
> VOICE 00:00:00.012 00:00:00.638 00:00:00.626
> VOICE 00:00:00.712 00:00:00.884 00:00:00.172
> 07 00:00:00.150 00:00:00.389 00:00:00.239
> VOICE 00:00:00.251 00:00:00.328 00:00:00.077
> 10 00:00:00.464 00:00:00.537 00:00:00.073
> VOICE 00:00:00.746 00:00:00.860 00:00:00.114"
>
> Using the code :
> Dim myVar As Variant
> Dim MyDataObj As New DataObject
>
> MyDataObj.GetFromClipboard
> myVar = MyDataObj.GetText()
>
> But the myVar variable is set to
> "Regions List: 0060aam3.wav
>
> Name In Out Duration
> -------------------------- ------------- ------------- -------------
> VOICE 00:00:00.012 00:00:00.638 00:00:00.626
> VOICE " after this instruction.
>
> I haved searched in google but not seen any limitation on string size.
> I have tried to empty clipboard or call again getText but this doesn't
> work either.
>
> Have anyone ever experienced this ?
> Any idea ?
>
> Thanks for your feedback,
>
> Cyril
>



 
Reply With Quote
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Clipboard gets empty by itself, cleared clipboard, copy paste doesn't work, outlook clears clipboard, problems with clipboard - possible solution Jens Hoerburger Microsoft Outlook 0 24th Aug 2006 02:44 PM
Using VB.Net or C#, utilizing the clipboard object, how to copy an MS Excel graphic from the clipboard to an image control and obtain its source reference TC Microsoft Dot NET 5 1st Sep 2004 05:49 AM
Using VB.Net or C#, utilizing the clipboard object, how to copy an MS Excel graphic from the clipboard to an image control and obtain its source reference TC Microsoft C# .NET 2 27th Jul 2004 06:07 PM
limit to copy and paste to/from clipboard =?Utf-8?B?QmlsbCBU?= Microsoft Word Document Management 2 20th May 2004 11:36 AM
Clipboard file size limit? LBorok Microsoft Windows 2000 2 26th Oct 2003 12:00 AM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 05:21 AM.