I have the following code used to attach a file to a spreadsheet:
Is there anyway of giving this object a name? I need to name it so that I can easily delete the file.
If I can't name it, is there an easy way to select and delete the file?
Code:
VarFile = Application.GetOpenFilename("All Files (*.*), *.*")
If VarFile <> False Then
ActiveSheet.OLEObjects.Add(Filename:= _
VarFile, Link:= _
False, DisplayAsIcon:=True, IconFileName:= _
"C:\WINDOWS\Installer\{90110409-6000-11D3-8CFE-0150048383C9}\wordicon.exe", _
IconIndex:=0, IconLabel:= _
VarFile).Select
End If
Is there anyway of giving this object a name? I need to name it so that I can easily delete the file.
If I can't name it, is there an easy way to select and delete the file?