View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
K Dales[_2_] K Dales[_2_] is offline
external usenet poster
 
Posts: 1,163
Default <Parent of the Clipboard

You would need to use Windows API calls. Since the clipboard can hold
multiple items it is not straightforward unless you have a controlled
situation. The clipboard has an "owner" - per the documentation:
"In general, the clipboard owner is the window that last placed data in
clipboard."
(I love those "in general" qualifiers!)

But this only identifies the last app to have cut or copied data into the
clipboard. There are more advanced techniques involving creating and
registering your own clipboard formats that could be used, but would be very
advanced coding.

Full details:
http://msdn.microsoft.com/library/de.../clipboard.asp
--
- K Dales


"Tim Childs" wrote:

Hi

Is it possible to determine the source filename of the contents of the
clipboard.

The reason I ask is that I am writing a utility for others to use for
re-arranging data in the clipboard prior to pasting that re-arrangement and
some of the code is dependent on the information gleaned from the
spreadsheet which is sitting in the clipboard.

Put another way:
a) user selects data (from one of three files) - puts it in clipboard
b) user selects destination in different speadsheet
c) user runs procedure which manipulates data (incl code dependent on the
one of three files chosen) and pastes it at the activecell

Any help very welcome.

Tim