Advertisement
YasserKhalil2019

T3789_Create Workbook Shortcut To Desktop IconLocation

Aug 25th, 2019
232
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.54 KB | None | 0 0
  1. https://excel-egy.com/forum/t3789
  2. ---------------------------------
  3.  
  4. Sub Create_Workbook_Shortcut_To_Desktop_Specify_IconLocation()
  5. Dim oWSH As Object
  6. Dim oShortcut As Object
  7.  
  8. Set oWSH = CreateObject("WScript.Shell")
  9. Set oShortcut = oWSH.CreateShortCut(oWSH.SpecialFolders("Desktop") & "\" & ThisWorkbook.Name & ".lnk")
  10.  
  11. With oShortcut
  12. .TargetPath = ThisWorkbook.FullName
  13. .IconLocation = ThisWorkbook.Path & "\3ds max.ico"
  14. .Save
  15. End With
  16. Set oWSH = Nothing
  17. End Sub
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement