Sabtu, 19 Maret 2016

Re: [ExcelVBA] Creating Shortcut to a Folder on the Desktop


Nice.... Should work fine.


Sent: Sat, Mar 19, 2016 3:18 pm
Subject: Re: [ExcelVBA] Creating Shortcut to a Folder on the Desktop

Dear Gary

Try this :-
Sub CreateShortCut(sFullFileOrFolderPathWithExtension As String, sShortcutTitle As String)
Dim sPathDeskTop As String
    With CreateObject("WScript.Shell")
        sPathDeskTop = .SpecialFolders("Deskt op") & "\"
        With .CreateShortCut(sPathDeskTop & sShortcutTitle & ".lnk")
            .TargetPath = sFullFileOrFolderPathWithExtension
        End With
    End With
End Sub

To keep it simple I did not put in error checking and I did not test it with folder names containing spaces. 


Derek Turner
England +++


Posted by: Green <>
Reply via web post Reply to sender Reply to group Start a New Topic Messages in this topic (4)
Be sure to check out TechTrax Ezine for many, free Excel VBA articles! Go here: to enter the ezine, then search the ARCHIVES for EXCEL VBA.

Visit our ExcelVBA group home page for more info and support files:

More free tutorials and resources available at:




Tidak ada komentar:

Posting Komentar