Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 4
Default Importing file handle name with pasted data

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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,163
Default Importing file handle name with pasted data

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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 4
Default Importing file handle name with pasted data

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
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
importing data from a txt file rrlogan Excel Worksheet Functions 1 May 15th 09 07:37 PM
Importing data file Mohit Excel Discussion (Misc queries) 1 June 1st 06 07:45 PM
Importing an address file (that was pasted into a Word doc) into E ssatterwhite Excel Discussion (Misc queries) 0 August 11th 05 11:47 PM
importing data from txt file onelson Excel Discussion (Misc queries) 0 August 2nd 05 02:24 PM
Excel TRIM() can't handle   in pasted HTML dyt Excel Discussion (Misc queries) 2 March 31st 05 08:11 PM


All times are GMT +1. The time now is 04:12 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"