LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
ina ina is offline
external usenet poster
 
Posts: 120
Default Problem to launch a program from Excel

Hello,

I have this sub that alows me to open the program PackLaunch from
Excel. The problem is that I have only one license of this program and
I need to open it only one time. if the program is already open I need
to exit from this sub. the problem is that the sub executes the if
twice and I do not know why.


Public Sub OpenPLaunch()

Dim appPack As String
Dim BoPack As Boolean


On Error Resume Next

appPack = "C:\Program Files\PLaunch\PLaunch.exe"
Shell appPack


If Err < 0 Then

BoPack = True ' if no error PLauch is open
Err.Clear
MsgBox "PLaunch is not open"
appPack = "C:\Program Files\PLaunch\PLaunch.exe"
Shell appPack
Exit if

Else

MsgBox "found PLauch open"
Exit Sub

End If

End Sub

Any help is kindly appreciated

Ina

 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Launch Program then load file Keyrookie Links and Linking in Excel 1 March 1st 10 11:45 PM
script to launch a program from excel calvin Excel Discussion (Misc queries) 4 January 29th 09 09:12 PM
can vb from excel launch another program? Mr BT Excel Worksheet Functions 0 August 16th 06 05:37 PM
How to launch one XLA from another on Excel launch levka Excel Programming 1 July 25th 05 04:22 AM
Macro launch - Button vs Manual launch , has different results. Wayne Excel Programming 4 February 23rd 05 11:33 AM


All times are GMT +1. The time now is 04:53 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"