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


Hi,

I have a app that cannot be linked to exel. I wrote some a littl
script when the data changes in the app it get auto copied to th
clipboard.
Is there a way in vb so I can monitor the clipboard so when it changes
it auto paste the new content in cell a1. ( so i will have a realtim
link )

Thanks

Joha

--
clima
-----------------------------------------------------------------------
climax's Profile: http://www.excelforum.com/member.php...fo&userid=3081
View this thread: http://www.excelforum.com/showthread.php?threadid=56378

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 703
Default clipboard monitor

Cool idea. I never thought of trying that before. This worked. You will
need to place two command buttons on Sheet1, change their captions to "Start
Monitor" and "End Monitor" The Start Monitor will start an endless loop with
a 1-second pause and a "DoEvents". The End Monitor will stop the loop.

Note - placing the command buttons on the sheet is also necessary to force
VB to add the "Microsoft Forms 2.0 Object Library" reference, which is
required for the DataObject.

Private Sub CommandButton1_Click()

Dim EndTime As Single
Dim PrevText As String
Dim objDataObject As New DataObject

Do
objDataObject.GetFromClipboard
If objDataObject.GetText(1) < PrevText Then
Range("A1") = objDataObject.GetText(1)
PrevText = objDataObject.GetText(1)
End If

Set objDataObject = Nothing
EndTime = Timer + 1 'one second
Do While Timer < EndTime
DoEvents
Loop

Loop

End Sub

Private Sub CommandButton2_Click()
End
End Sub


"climax" wrote:


Hi,

I have a app that cannot be linked to exel. I wrote some a little
script when the data changes in the app it get auto copied to the
clipboard.
Is there a way in vb so I can monitor the clipboard so when it changes
it auto paste the new content in cell a1. ( so i will have a realtime
link )

Thanks

Johan


--
climax
------------------------------------------------------------------------
climax's Profile: http://www.excelforum.com/member.php...o&userid=30816
View this thread: http://www.excelforum.com/showthread...hreadid=563781


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
Where does Ms XL store the clipboard ? or where does MS Windowsstore clipboard ? Subu Setting up and Configuration of Excel 1 May 18th 09 06:56 AM
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
monitor clipboard climax Excel Discussion (Misc queries) 0 July 21st 06 05:28 PM
ClearContents or ClearFormats also clears Clipboard. How can I keep the clipboard? [email protected] Excel Programming 5 December 16th 05 02:30 AM


All times are GMT +1. The time now is 11:36 PM.

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"