Problem on openning a program via Excel

I

ina

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top