You can't really attach a file to a particular cell, but you can put the
link icon in a particular cell, size the same as the cell, and set it to
move and size with the cell. It will look as though it part of the cell, but
it really isn't. Use code like the following:
Dim OleObj As OLEObject
With ActiveSheet.Range("C3") '<<< Change to appropriate cell
Set OleObj = ActiveSheet.OLEObjects.Add(Filename:="C:\Susan.doc ",
Link:=True, _
DisplayAsIcon:=True)
OleObj.Top = .Top
OleObj.Left = .Left
OleObj.Width = .Width
OleObj.Height = .Height
OleObj.Placement = xlMoveAndSize
End With
There is, however, no way (directly) to determine from a cell whether there
is a document associated with that cell.
--
Cordially,
Chip Pearson
Microsoft MVP - Excel
Pearson Software Consulting, LLC
www.cpearson.com
(email address is on the web site)
"chance" wrote in message
...
how do i, or can i attach a file to a particular cell in a spreadsheet?