When using ShellExecute with some LNK Files as error 5 ( Access Denied ) error is returned. ( see example below )
However you can run the line below by clicking on
Start-Run and pasting C:\Documents and Settings\All Users\Start Menu\Programs\Microsoft Office\Microsoft Office Word 2003.lnk
Any help in getting this issue resolved will be appreciated.
Example:
FileName = "C:\Documents and Settings\All Users\Start Menu\Programs\Microsoft Office\Microsoft Office Word 2003.lnk"
iRet = ShellExecute(GetDesktopWin
dow, "open", FileName, vbNullString, vbNullString, vbNormalFocus)
If lRet = 5 Then
MsgBox "Access Denied" & vbCrLf & "Try pointing directely to the program EXE", , ""
End If
Start Free Trial