View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
Joyce Joyce is offline
external usenet poster
 
Posts: 106
Default Display only file name in embedded icon

Sorry, am living up to being a blonde today! ;-)

Sub InsertFile()


Dim vFile As Variant
vFile = Application.GetOpenFilename("All Files,*.*", Title:=" Find file to
insert")
If LCase(vFile) = "false" Then Exit Sub
ActiveSheet.OLEObjects.Add Filename:=vFile, Link:=True, DisplayAsIcon:=True,
IconFileName:= _
"C:\WINDOWS\Installer\{90110409-6000-11D3-8CFE-0150048383C9}\xlicons.exe", _
IconIndex:=0, IconLabel:=vFile
End Sub

"Rick Rothstein" wrote:

I don't see the code you referred to.

--
Rick (MVP - Excel)


"Joyce" wrote in message
...
Hello,

I'm using the code below with a command button to allow users to easily
insert files as icons into an Excel file.

I'd ideally like only the name of the file (as opposed to the entire path)
to be displayed. Is this possible?

Thanks!