View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Jim Rech Jim Rech is offline
external usenet poster
 
Posts: 2,718
Default Desktop Shorcuts

Here's an example:

Sub MakeDesktopShortcut()
Dim wsh As Object
Dim SC As Object
Dim DesktopPath As String
Set wsh = CreateObject("WScript.Shell")
DesktopPath = wsh.SpecialFolders.Item("Desktop")
Set SC = wsh.CreateShortcut(DesktopPath & "\test.lnk")
SC.TargetPath = "C:\book1.xls"
SC.Hotkey = "CTRL+ALT+Z"
SC.Save
Set wsh = Nothing
End Sub

--
Jim Rech
Excel MVP
"asmenut" wrote in message
...
| Is there a way that I can (via VBA) create a shortcut to a spreadsheet or
| folder on the desktop.
| (Example: My application (wizard) has data for the user to fill out. When
| he/she presses finish, the wizard fills out the form, creates a folder and
| saves the form into that folder. The user then would like the wizard to
| create a desktop shortcut to that folder so that he/she can work with the
| files at a later time (Engineering Maintenence).