Dragging files iknto Excel


Posted by J D on July 03, 2001 9:53 AM

I would like to drag a file from Windows Explorer into a cell and just have the file name entered into the cell. By default Excel writes all of the file's data into Excel when I do this. Is there a way to override this functionality and make it do what I want?



Posted by Ben O. on July 03, 2001 10:54 AM

I don't know how to do what you're asking, but this macro will let you browse for a file and insert it's path & name into the active cell:

Sub GetFileName()
x = Application.GetOpenFilename
ActiveCell.Value = x
End Sub

-Ben