Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
sth sth is offline
external usenet poster
 
Posts: 5
Default Capturing text in active cell to clipborad (Excel 95)

My Excel programming skill are not very good, so plz excuse my
ignorance.

Through an Excel macro, I would like to automate capturing into the
clipboard the text in a selected cell. I have tried using
Selection.Copy
command but the app that will be receiving the copied cell returns an
errror message stating that only text can be pasted.

I also tried using this code, which I scavenged from
http://www.cpearson.com/excel/clipboar.htm:

Public Sub PutOnClipboard(Obj As Variant)
Dim MyDataObj As New DataObject
MyDataObj.SetText Format(Obj)
MyDataObj.PutInClipboard
End Sub

Public Function GetOffClipboard() As Variant
Dim MyDataObj As New DataObject
MyDataObj.GetFromClipboard
GetOffClipboard = MyDataObj.GetText()
End Function

Public Sub ClearClipboard()
Dim MyDataObj As New DataObject
MyDataObj.SetText ""
MyDataObj.PutInClipboard
End Sub

However, Excel 95 shows the following as error:
Dim MyDataObj As New DataObject

Is there a way to get Excel 95 (v 7.0) to perform this task?

Thx much.
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 107
Default Capturing text in active cell to clipborad (Excel 95)

It's been a while, but if I recall correctly, there was a Clipboard
object back then.

Have you tried this:

Clipboard.Clear
Clipboard.SetText Range("A1").Text

sth wrote:
My Excel programming skill are not very good, so plz excuse my
ignorance.

Through an Excel macro, I would like to automate capturing into the
clipboard the text in a selected cell. I have tried using
Selection.Copy
command but the app that will be receiving the copied cell returns an
errror message stating that only text can be pasted.

I also tried using this code, which I scavenged from
http://www.cpearson.com/excel/clipboar.htm:


<snip

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default Capturing text in active cell to clipborad (Excel 95)

In VB (and still is). I don't believe there was one in VBA.

--
Regards,
Tom Ogilvy

"Steve Garman" wrote in message
...
It's been a while, but if I recall correctly, there was a Clipboard
object back then.

Have you tried this:

Clipboard.Clear
Clipboard.SetText Range("A1").Text

sth wrote:
My Excel programming skill are not very good, so plz excuse my
ignorance.

Through an Excel macro, I would like to automate capturing into the
clipboard the text in a selected cell. I have tried using
Selection.Copy
command but the app that will be receiving the copied cell returns an
errror message stating that only text can be pasted.

I also tried using this code, which I scavenged from
http://www.cpearson.com/excel/clipboar.htm:


<snip



  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 63
Default Capturing text in active cell to clipborad (Excel 95)

Hi sth;
Using DataObject need a reference to Microsoft Forms 2.0 Object Library
MP

"sth" a écrit dans le message de
om...
My Excel programming skill are not very good, so plz excuse my
ignorance.

Through an Excel macro, I would like to automate capturing into the
clipboard the text in a selected cell. I have tried using
Selection.Copy
command but the app that will be receiving the copied cell returns an
errror message stating that only text can be pasted.

I also tried using this code, which I scavenged from
http://www.cpearson.com/excel/clipboar.htm:

Public Sub PutOnClipboard(Obj As Variant)
Dim MyDataObj As New DataObject
MyDataObj.SetText Format(Obj)
MyDataObj.PutInClipboard
End Sub

Public Function GetOffClipboard() As Variant
Dim MyDataObj As New DataObject
MyDataObj.GetFromClipboard
GetOffClipboard = MyDataObj.GetText()
End Function

Public Sub ClearClipboard()
Dim MyDataObj As New DataObject
MyDataObj.SetText ""
MyDataObj.PutInClipboard
End Sub

However, Excel 95 shows the following as error:
Dim MyDataObj As New DataObject

Is there a way to get Excel 95 (v 7.0) to perform this task?

Thx much.



  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default Capturing text in active cell to clipborad (Excel 95)

Dataobject was added in xl97. so it isn't available in Excel 95.

--
Regards,
Tom Ogilvy

"Michel Pierron" wrote in message
...
Hi sth;
Using DataObject need a reference to Microsoft Forms 2.0 Object Library
MP

"sth" a écrit dans le message de
om...
My Excel programming skill are not very good, so plz excuse my
ignorance.

Through an Excel macro, I would like to automate capturing into the
clipboard the text in a selected cell. I have tried using
Selection.Copy
command but the app that will be receiving the copied cell returns an
errror message stating that only text can be pasted.

I also tried using this code, which I scavenged from
http://www.cpearson.com/excel/clipboar.htm:

Public Sub PutOnClipboard(Obj As Variant)
Dim MyDataObj As New DataObject
MyDataObj.SetText Format(Obj)
MyDataObj.PutInClipboard
End Sub

Public Function GetOffClipboard() As Variant
Dim MyDataObj As New DataObject
MyDataObj.GetFromClipboard
GetOffClipboard = MyDataObj.GetText()
End Function

Public Sub ClearClipboard()
Dim MyDataObj As New DataObject
MyDataObj.SetText ""
MyDataObj.PutInClipboard
End Sub

However, Excel 95 shows the following as error:
Dim MyDataObj As New DataObject

Is there a way to get Excel 95 (v 7.0) to perform this task?

Thx much.







  #6   Report Post  
Posted to microsoft.public.excel.programming
sth sth is offline
external usenet poster
 
Posts: 5
Default Capturing text in active cell to clipborad (Excel 95)

Steve, Thx for the attempt but those commands resulted in an error
message: "Object required."

=====

Steve Garman wrote in message ...
It's been a while, but if I recall correctly, there was a Clipboard
object back then.

Have you tried this:

Clipboard.Clear
Clipboard.SetText Range("A1").Text

sth wrote:
My Excel programming skill are not very good, so plz excuse my
ignorance.

Through an Excel macro, I would like to automate capturing into the
clipboard the text in a selected cell. I have tried using
Selection.Copy
command but the app that will be receiving the copied cell returns an
errror message stating that only text can be pasted.

I also tried using this code, which I scavenged from
http://www.cpearson.com/excel/clipboar.htm:


<snip

  #7   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Capturing text in active cell to clipborad (Excel 95)

So, In Excel 95 I am SOL? Can't get there from here?

=====

On Mon, 3 May 2004 13:58:42 -0400, "Tom Ogilvy"
wrote:

Dataobject was added in xl97. so it isn't available in Excel 95.


  #8   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 107
Default Capturing text in active cell to clipborad (Excel 95)

Having already established that I don't remember XL95 very well, there's
a function here that might be of some use to you:

http://groups.google.com/groups?selm...itenntp.io.com

wrote:
So, In Excel 95 I am SOL? Can't get there from here?

=====

On Mon, 3 May 2004 13:58:42 -0400, "Tom Ogilvy"
wrote:


Dataobject was added in xl97. so it isn't available in Excel 95.




  #9   Report Post  
Posted to microsoft.public.excel.programming
sth sth is offline
external usenet poster
 
Posts: 5
Default Capturing text in active cell to clipborad (Excel 95)

That link was excellent. Problem solved! Thx much, Steve.

=====

Steve Garman wrote in message ...
Having already established that I don't remember XL95 very well, there's
a function here that might be of some use to you:

http://groups.google.com/groups?selm...itenntp.io.com

wrote:
So, In Excel 95 I am SOL? Can't get there from here?

=====

On Mon, 3 May 2004 13:58:42 -0400, "Tom Ogilvy"
wrote:


Dataobject was added in xl97. so it isn't available in Excel 95.



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
Capturing a word sequence as part of a text in a spreadsheet cell T.Mad Excel Worksheet Functions 4 July 3rd 07 12:08 PM
Is there a way to change the active cell by a text box? [email protected] Excel Discussion (Misc queries) 1 March 30th 07 03:15 PM
Capturing Shape Name/Text from OnAction property William Bartusek Excel Discussion (Misc queries) 3 April 12th 05 06:38 PM
Iterating through workbook capturing text Matt Giedt Excel Programming 2 February 5th 04 10:49 AM
Selecting Active Cell before Text Import Routine Paul Excel Programming 2 November 17th 03 10:01 PM


All times are GMT +1. The time now is 02:03 PM.

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

About Us

"It's about Microsoft Excel"