Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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! |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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/de.../clipboard.asp -- - K Dales " wrote: 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! |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Thanks a bunch!
I'll check up on the website. - Michael K Dales wrote: 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/de.../clipboard.asp -- - K Dales " wrote: 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! |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
importing data from a txt file | Excel Worksheet Functions | |||
Importing data file | Excel Discussion (Misc queries) | |||
Importing an address file (that was pasted into a Word doc) into E | Excel Discussion (Misc queries) | |||
importing data from txt file | Excel Discussion (Misc queries) | |||
Excel TRIM() can't handle in pasted HTML | Excel Discussion (Misc queries) |