PDA

View Full Version : Launch Shortcut(lnk) through VBA



parscon
10-30-2013, 04:49 AM
I have a VBA code that when run it it will launch clear.lnk but when it will be launch a windows will open and ask me would you like to open file and i must push the yes . is it possible launch the lnk without ask any question ?
Thank you.


Sub Openlnk()

On Error GoTo 1
ActiveWorkbook.FollowHyperlink "D:\clear.lnk", NewWindow:=True
Exit Sub
1: MsgBox Err.Description
End Sub

Paul_Hossler
10-30-2013, 10:02 AM
THis MIGHT work (Application.DisplayAlerts)



Sub Openlnk()

On Error Goto 1
Application.DisplayAlerts = False
ActiveWorkbook.FollowHyperlink "D:\clear.lnk", NewWindow:=True
Application.DisplayAlerts = True
Exit Sub
1: MsgBox Err.Description
End Sub



Paul