craig159753
New Member
- Joined
- Apr 21, 2015
- Messages
- 24
Hi all,
I am trying to open a SAS.EXE application through a .lnk file (i.e. a shortcut). The code I have so far is as follows
First bit declares a new function:
This bit is my VBA call to open said .lnk file.
The code does not fail, when i run it the mouse icon loads for one second then nothing, any ideas?
Thanks
I am trying to open a SAS.EXE application through a .lnk file (i.e. a shortcut). The code I have so far is as follows
First bit declares a new function:
Code:
Public Declare Function ShellExecute _
Lib "shell32.dll" _
Alias "ShellExecuteA" ( _
ByVal hwnd As Long, _
ByVal lpOperation As String, _
ByVal lpFile As String, _
ByVal lpParameters As String, _
ByVal lpDirectory As String, _
ByVal nShowCmd As Long) _
As Long
This bit is my VBA call to open said .lnk file.
Code:
Sub mymacro()
ShellExecute 0, "OPEN", "C:\Docs\myshortcut.lnk", "", "", 1
End Sub
The code does not fail, when i run it the mouse icon loads for one second then nothing, any ideas?
Thanks