Thread: icon problem
View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
Tempy Tempy is offline
external usenet poster
 
Posts: 203
Default icon problem

Good day, i got some code from Bob Phillips, to create an icon and added
in iconlocation from his suggestion which works 100%.
I want to send all the users an excel file with the code in and when
they open it, it will create folders and save the file in there. I then
create a short cut and then want to assign a different icon to it.
I am not sure how to do last portion, should i insert the icon on the
spread sheet so that it can save it also to the folder ?


----------------------------------------------------------------
Sub CreateShortCut()
'----------------------------------------------------------------
Dim oWSH As Object
Dim oShortcut As Object
Dim sPathDeskTop As String

Set oWSH = CreateObject("WScript.Shell")
sPathDeskTop = oWSH.SpecialFolders("Desktop")

Set oShortcut = oWSH.CreateShortCut(sPathDeskTop & "\" & _
ActiveWorkbook.Name & ".lnk")
With oShortcut
.TargetPath = ActiveWorkbook.FullName
.IconLocation "C:\icons\test.ico"
.Save
End With
Set oWSH = Nothing

End Sub



Tempy

*** Sent via Developersdex http://www.developersdex.com ***