Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 177
Default Clipboard Question

I have and Excel 97 - 2003 add-in that under certain circumstances uses the
clipboard. Before using the clipboard I try to save its contents using code
like the following:

Dim MyDataObj As New DataObject
Dim SaveOfClipboard As Variant

MyDataObj.GetFromClipboard
SaveOfClipboard = MyDataObj.GetText()

so that I can restore it when I'm done in case the user has something of
interest to them on the clipboard.

This mostly works OK unless the user has a bunch of data on the clipboard in
which case only the first bit of clipboard data is saved using the above
code.

Is there a better/more complete way of quickly saving and restoring the
contents of the clipboard? I think doing a File | Save of the clipboard
will be too slow so I need something that performs better.

TIA,

josh


  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 177
Default Clipboard Question

David,

Thanks for the pointer to Chip's page. I clearly had found that page a few
years ago when I first added this feature because the code in question is
nearly identical to Chip's.

So it is with Chip's code that I'm having the problem with the text on the
clipboard being truncated. I can't really tell if the truncation occurs
when I try to save the contents (i.e., the code only gets a portion of the
clipboard's contents) or on restore (i.e., only a portion of what was
previously saved is restored).

Any further thoughts?

josh






  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 691
Default Clipboard Question

Hi Josh,
You may have already gotten a better answer, sorry for not checking first.

Are you copying from one cell in Excel, or from somewhere else.
If from somewhere else you could be exceeding limits in Excel.
Look up "specification" as in "specification limits" in Excel.
---
HTH,
David McRitchie, Microsoft MVP - Excel [site changed Nov. 2001]
My Excel Pages: http://www.mvps.org/dmcritchie/excel/excel.htm
Search Page: http://www.mvps.org/dmcritchie/excel/search.htm

"Josh Sale" <jsale@tril dot cod wrote in message ...
David,

Thanks for the pointer to Chip's page. I clearly had found that page a few
years ago when I first added this feature because the code in question is
nearly identical to Chip's.

So it is with Chip's code that I'm having the problem with the text on the
clipboard being truncated. I can't really tell if the truncation occurs
when I try to save the contents (i.e., the code only gets a portion of the
clipboard's contents) or on restore (i.e., only a portion of what was
previously saved is restored).

Any further thoughts?

josh








  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 177
Default Clipboard Question

Well David, I'm still searching for clipboard salvation.

My problem is that the user may have copy'ed a bunch of stuff onto the
clipboard ... that bunch of stuff is within Excel's limits.

Sometimes my code needs to use the clipboard (e.g., .Copy followed by
..PasteSpecial). In these cases I try to be a good citizen and save the
contents of the clipboard using Chip's code prior to using it myself. When
I'm done using the clipboard, I again use Chip's code to restore the
previously saved contents.

Its during either the save or restore that the stuff the user placed on the
clipboard is being truncated. My program's operation with the clipboard
works fine. If my code didn't try to use the clipboard, the user's stuff
would all be there just fine (e.g., they haven't exceeded Excel's limits).

So I'm just looking for the moral equivalent of Chip's code but without the
apparent size limitations.

Hope this makes things clearer.

TIA,

josh


"David McRitchie" wrote in message
...
Hi Josh,
You may have already gotten a better answer, sorry for not checking

first.

Are you copying from one cell in Excel, or from somewhere else.
If from somewhere else you could be exceeding limits in Excel.
Look up "specification" as in "specification limits" in Excel.
---
HTH,
David McRitchie, Microsoft MVP - Excel [site changed Nov. 2001]
My Excel Pages: http://www.mvps.org/dmcritchie/excel/excel.htm
Search Page: http://www.mvps.org/dmcritchie/excel/search.htm

"Josh Sale" <jsale@tril dot cod wrote in message

...
David,

Thanks for the pointer to Chip's page. I clearly had found that page a

few
years ago when I first added this feature because the code in question

is
nearly identical to Chip's.

So it is with Chip's code that I'm having the problem with the text on

the
clipboard being truncated. I can't really tell if the truncation occurs
when I try to save the contents (i.e., the code only gets a portion of

the
clipboard's contents) or on restore (i.e., only a portion of what was
previously saved is restored).

Any further thoughts?

josh










Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

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


Similar Threads
Thread Thread Starter Forum Replies Last Post
Excel 2003 Clipboard Question CommMajor Excel Discussion (Misc queries) 6 November 11th 09 09:21 PM
Where does Ms XL store the clipboard ? or where does MS Windowsstore clipboard ? Subu Setting up and Configuration of Excel 0 May 5th 09 01:20 PM
Clipboard empty but still get waring that clipboard is full Steve Excel Discussion (Misc queries) 0 June 17th 08 09:05 PM
Clipboard question AJ Excel Programming 0 March 5th 04 09:14 PM
My last week question: how delete the Office Clipboard (XP) aldo Excel Programming 4 January 20th 04 01:15 AM


All times are GMT +1. The time now is 06:12 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"