0

When trying to run a AHK script from excel the 1st way using shell

Sub FrmShell()
Shell ("C:\Program Files\AutoHotkey\AutoHotkey.exe  \\REG-MITEK\Mitek\Mitek\documentation\RequestForQuote\old-RFP\RFP.exe")
End Sub

I get this error

enter image description here

When I run it with FollowHyperlink, it works but can't get away from the dreaded hyperlink warning.

Sub FromHyperLink()
Dim s As String    
s = "\\REG-MITEK\Mitek\Mitek\documentation\RequestForQuote\old-RFP\RFP.exe"    
ThisWorkbook.FollowHyperlink (s)
End Sub
Rich
  • 4,134
  • 3
  • 26
  • 45
Davesexcel
  • 6,896
  • 2
  • 27
  • 42
  • 1. Try open the Run menu (pressing Win+R) and run the `C:\Program Files\AutoHotkey\AutoHotkey.exe \\REG-MITEK\Mitek\Mitek\documentation\RequestForQuote\old-RFP\RFP.exe` (without quotes). 2. Check that statement - you're trying to open one application with another, as far as I know - the syntax should be "Application_path fileToOpen_path". 3 Does `Application.DisplayAlerts` set to false help? – Vitaliy Prushak Jan 09 '20 at 17:42
  • 1- same error popped up 2-Yep that did it, did not need to open AHK first,3-Displayalerts does not work for opening files with hyperlinks. If you want to answer this with #2 that would be great and I can check it off – Davesexcel Jan 09 '20 at 18:09

1 Answers1

1

As per comment, posting an answer:

Check that statement - you're trying to open one application with another, as far as I know - the syntax should be "Application_path fileToOpen_path".

Possible decisions for #3 (requires registry access):

Circumvent Hyperlink Security Warning

and

here

But I didn't try neither.

Vitaliy Prushak
  • 1,057
  • 8
  • 13