Try...
Code:
Function fncCreateShortcut(strPathFile, strShortcutName) As String
'11.23.2012 Crystal Long
'4.2.2018 Gina Whipp (Access Diva) changed to a Function and removed hardcoding
' for early binding -- needs reference to Windows Script Host Object Module
'this code uses late binding so no reference is necessary
On Error GoTo Proc_Err
Dim oWsh As Object
Dim oShortcut As Object
Dim strPathDesktop As String
Dim sShortcut As String
Set oWsh = CreateObject("WScript.Shell")
strPathDesktop = oWsh.SpecialFolders("Desktop")
sShortcut = strPathDesktop & "\" & strShortcutName & ".lnk"
Set oShortcut = oWsh.CreateShortcut(sShortcut)
With oShortcut
.TargetPath = strPathFile
'.Description = "Description of icon"
'.RelativePath = "C:\temp"
'.WorkingDirectory = "M:\"
'.IconLocation = "F:\Code11\test.ico"
.Save
End With
MsgBox "Shortcut created!"
Proc_Exit:
On Error Resume Next
Set oShortcut = Nothing
Set oWsh = Nothing
Exit Function
Proc_Err:
MsgBox Err.Description, , "ERROR " & Err.Number & " CreateShortcut "
Resume Proc_Exit
Resume
End Function