Option Explicit
'Private 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
Public Sub LEDTool6()
If Application.VersionMajor < 14 Then
MsgBox "This macro for CorelDRAw X4 or CorelDRAW X5 or CorelDRAW X6 only!", vbInformation, "LEDTool5"
Exit Sub
End If
If Application.VersionMajor = 14 And Application.VersionBuild < 701 Then
MsgBox "You haven't installed Service Pack 2 for CorelDRAW X4.", vbInformation, "LEDTool5"
Exit Sub
End If
If Application.VersionMajor = 15 And Application.VersionBuild < 661 Then
MsgBox "You haven't installed Service Pack 3 for CorelDRAW X5.", vbInformation, "LEDTool5"
Exit Sub
End If
Dim FileXML As String, pth As String, FileEXE As String, Filelic As String, pth2 As String
Dim inter1 As String, inter2 As String
Dim progname As String
If Application.VersionMajor = 14 Then
progname = "LEDTool6_X4_setup.exe"
pth = Environ$("appdata") & "\APSoftMacro\X4\"
' inter1 = pth & "Interop.CorelDRAW.dll"
' inter2 = pth & "Interop.VGCore.dll"
End If
If Application.VersionMajor = 15 Then
progname = "LEDTool6_X5_setup.exe"
pth = Environ$("appdata") & "\APSoftMacro\X5\"
' inter1 = pth & "Interop.CorelDRAW.dll"
' inter2 = pth & "Interop.VGCore.dll"
End If
If Application.VersionMajor = 16 Then
progname = "LEDTool6_X6_setup.exe"
pth = Environ$("appdata") & "\APSoftMacro\X6\"
' inter1 = pth & "Corel.Interop.CorelDRAW.dll"
' inter2 = pth & "Corel.Interop.VGCore.dll"
End If
pth2 = Environ$("appdata") & "\APSoftMacro\LEDTool6\Settings\"
FileEXE = pth & "LEDTool6.exe"
FileXML = pth2 & "LEDTool6_Set.xml"
Filelic = pth2 & "LEDTool6.lic"
If Dir(FileXML) = "" Then MsgBox "No file " & FileXML & "!" & vbCrLf & "Run " & progname & "!", vbCritical, "LEDTool6": Exit Sub
If Dir(FileEXE) = "" Then MsgBox "No file " & FileEXE & "!" & vbCrLf & "Run " & progname & "!", vbCritical, "LEDTool6": Exit Sub
If Dir(Filelic) = "" Then MsgBox "No file " & Filelic & "!" & vbCrLf & "Run " & progname & "!", vbCritical, "LEDTool6": Exit Sub
' If Dir(inter1) = "" Then MsgBox "No file " & inter1 & "!" & vbCrLf & "Run " & progname & "!", vbCritical, "LEDTool5": Exit Sub
' If Dir(inter2) = "" Then MsgBox "No file " & inter2 & "!" & vbCrLf & "Run " & progname & "!", vbCritical, "LEDTool5": Exit Sub
' ShellExecute 0, "Open", FileEXE, "", pth, 1
Dim RetVal
RetVal = Shell(pth & "LEDTool6.exe", 1)
End Sub