Importing file handle name with pasted data

M

mckrs

Hello,

Does anyone know of a function (if this is even possible in Excel),
that imports a file handle (name of the source file) & displays
it in an adjacent cell every time that I cut & paste data from that
file into Excel.

For example, I copy a text string from the text file 'data.txt'
into the clipboard, I bring up the Excel Worksheet, paste the
data into a cell & the cell in the same row, next column over
automatically populates with the path & filename of the origin
('C:\My Documents\data.txt' in this case).

Any help on this is thoroughly appreciated.

Thanks!
 
G

Guest

If it is possible it is not easy. If the source application supports OLE via
cut and paste it would be easier, since you could paste the link and then
extract the value from the resulting cell and then extract the linked file
name from the cell formula. But that won't be true for all apps.

If anything you would have to develop your own clipboard routines to handle
this. Can't even say if that is possible, although there is a clipboard
function, GetClipboardOwner, that does in general get the handle to the last
app that copied into the clipboard. But I have never tried anything that
complex and wouldn't want to. In case you do, here is a link to the info
about the Clipboard functions from the Windows API:
http://msdn.microsoft.com/library/d...ndowsuserinterface/dataexchange/clipboard.asp
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top