ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Problem on openning a program via Excel (https://www.excelbanter.com/excel-programming/361464-problem-openning-program-via-excel.html)

ina

Problem on openning a program via Excel
 
Hello guys I would like to open this program throught Excel and I have
this code

Option Explicit

'This code allows me to open PLaunch
Public Sub OpenPLaunchShell()

Dim appPack As String
Dim BoPack As Boolean


On Error Resume Next


If Err < 0 Then


BoPack = True ' if no error PLaunch is open
Err.Clear
'If the program open already MsgBox "Packhedge is not open"
appPack = "C:\Program Files\Packhedge\Packhedge.exe"
Shell appPack

Exit Sub


Else

'If the program is already open I do not open it.
MsgBox "found PLaunch open already"
Exit Sub


End If


End Sub

but the program is launching twice everytime and I do not know why?

Ina



All times are GMT +1. The time now is 04:41 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com