How to create desktop shortcut to file

  • Thread starter Thread starter buell4720
  • Start date Start date
B

buell4720

I have a macro that goes thru my file and does some random hiliting fo
audit purposes and also saves the workbook using date&time. What
want to do is create a shortcut to this file on the users desktop t
save them from having to navigate the path to get to the file.

HELP !!!
 
B,

There are a couple of ways to do this.
A search of Google for "Create Shortcut" should turn up others.

See if this may work for you:

Sub Desktopshortcut()
' Submitted by William West
Dim WSHShell As Object
Dim MyShortcut As Object
Dim DesktopPath As String
Set WSHShell = CreateObject("WScript.Shell")
DesktopPath = WSHShell.SpecialFolders("Desktop")
Set MyShortcut = WSHShell.CreateShortcut(DesktopPath & "\" &
ActiveWorkbook.Name & ".lnk")
With MyShortcut
..TargetPath = ActiveWorkbook.FullName
..Save
End With
Set WSHShell = Nothing
MsgBox "A shortcut has been placed on your desktop."
End Sub

John
 
buell4720 said:
I have a macro that goes thru my file and does some random hiliting for
audit purposes and also saves the workbook using date&time. What I
want to do is create a shortcut to this file on the users desktop to
save them from having to navigate the path to get to the file.

Speaking as an end user, I've spent too damn much of my time PREVENTING
do-goody IT types littering my desktop with all sorts of "helpful"
shortcuts. I've come up with a few methods that are guaranteed to prevent
this.

Whenever trying to be "helpful", why not present the user with a Yes/No
dialog asking them whether or not they want this? Wouldn't that be even more
helpful?

It's really true - some users get VERY ANNOYED with excessive "helpfulness".
 
I prefer to do as follows:
Right-Click on the background of the Desktop (a pop-up menu should appear).
Select (Left-click) from it New, then Shortcut. Follow wizard-type
instructions from there.
HTH
 
Simply navigate to the file in Windows Explorer.

Right click the filename and drag to the desktop

All is done! HTH

Dennis
 
Back
Top