Sign in to follow this  
Followers 0
dcjohnston

Calling an autoit exe from VB 6

7 posts in this topic

#1 ·  Posted (edited)

Hey, I am using a VB front end to call an autoit exe file. However if VB is running auto it exe files will not execute.

PlatformApp = Shell("c:\platformup.exe", 1)   ' Start Application
       AppActivate PlatformApp

I see the Autoit icon pop up but for a millisecond.

Help.

Dave

Edited by dcjohnston

Share this post


Link to post
Share on other sites



Must be something wrong with your coding.

Give an example of your code.

Share this post


Link to post
Share on other sites

This is the full Code with error handler. If I close VB then the the autoit.exe file works fine.

Private Sub Command3_Click()
On Error GoTo ErrorHandler

    PlatformApp = Shell("c:\platformup.exe", 1)   ' Start Application
       AppActivate PlatformApp

ErrorHandler:                        ' Error-handling routine.
  Select Case Err.Number  ' Evaluate error number.
  Case 75
    Close #1    ' Close open file.
    Resume Next
  Case 53
    MsgBox "The Platform App was not found at C:\."
    Resume Next
  Case 5
    Resume Next
  Case Else
End Select
End Sub

Thanks

Share this post


Link to post
Share on other sites

I tested in VBA and in Excel VB with a simple script and it works fine for me. Must be an issue in your coding in "platformup.exe".

Share this post


Link to post
Share on other sites

If you could post the code for the script that would help us tell you the problem... It sounds like you have an If statement in your code (the fact that the autoit icon shows for a split second means that the code tried to run but it was exited before it could do anything) that is exiting because of a parameter that you supplied.

JS


AutoIt Links

File-String Hash Plugin Updated! 04-02-2008 Plugins have been discontinued. I just found out.

ComputerGetInfo UDF's Updated! 11-23-2006

External Links

Vortex Revolutions Engineer / Inventor (Web, Desktop, and Mobile Applications, Hardware Gizmos, Consulting, and more)

Share this post


Link to post
Share on other sites

Yup it was this code.... from the platformup.exe. This is the code from the examples in the help so everyone take note if you are using it.

$g_szVersion = "Platform Upgrade"
If WinExists($g_szVersion) Then Exit; It's already running
AutoItWinSetTitle($g_szVersion)

It was to keep the app from running multiple instances. Very interesting.

Thanks for your time.

Dave

Share this post


Link to post
Share on other sites

Is the title of your VB gui "Platform Upgrade" ? If so, you just shot yourself in the foot.


Who else would I be?

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0