The Message Box works but how do you tie together by clicking "Yes" it starts running the program fsav.exe?
Option Explicit
Dim MessageBox
Dim RunScan
RunScan = "C:\Program Files\F-Secure\Anti-Virus\fsav.exe"
MessageBox = MsgBox("Run Anti-Virus Scan Now?", _
vbYesNoCancel + vbQuestion, _
"F-Secure")
If MessageBox = "Yes" Then
Run RunScan
End If
Option Explicit
Dim MessageBox
Dim RunScan
RunScan = "C:\Program Files\F-Secure\Anti-Virus\fsav.exe"
MessageBox = MsgBox("Run Anti-Virus Scan Now?", _
vbYesNoCancel + vbQuestion, _
"F-Secure")
If MessageBox = "Yes" Then
Run RunScan
End If
-------------------
Try this - substitute Excel for F-Secure.
Code:
Option Explicit Sub Run(ByVal sFile) Dim shell Set shell = CreateObject("WScript.Shell") shell.Run Chr(34) & sFile & Chr(34), 1, false Set shell = Nothing End Sub Dim MessageBox Dim RunScan RunScan="C:\Program Files\Microsoft Office\Office12\EXCEL.EXE" MessageBox=MsgBox("Run Excel Now?",vbYesNo,"Excel") If MessageBox=6 Then Run RunScan End If
No comments:
Post a Comment