Consulting

Results 1 to 2 of 2

Thread: Launch Shortcut(lnk) through VBA

  1. #1
    VBAX Mentor
    Joined
    Feb 2012
    Posts
    406
    Location

    Question Launch Shortcut(lnk) through VBA

    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

  2. #2
    VBAX Sage
    Joined
    Apr 2007
    Location
    United States
    Posts
    8,726
    Location
    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

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •