LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #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.
 
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 12:32 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"