icon problem

T

Tempy

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 ***
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads


Top