Solved

VB6 Runtime Error 5 When calling an external executable

Posted on 2013-10-23
7
314 Views
Last Modified: 2013-10-24
I'm having a strange issue with a particular client running an external executable. I've done this very same thing before, and in fact it works fine from other machines using the same application. But on this one machine I get this runtime error.  Here is the code:
Private Sub cmdClock_Click()
Dim X As Long
Dim handle As Long
Dim cmndStr As String
    
    handle = FindWindow("ThunderRT6FormDC", "Scalper Cycle Clock")
    If handle <> 0 Then
        AppActivate "Scalper Cycle Clock"
        X = ShowWindow(handle, 1)
        X = SetWindowFocus(handle)
    Else
        cmndStr = "\\hmnassrvr\HMNASSRVR_D\Applications\Scalper_Cycle_TM\Scalper Cycle TM.exe "
        X = Shell(cmndStr, 1)
        'DoEvents
    End If

End Sub

Open in new window

I thought maybe there was a problem with the spaces in the executable name, but I removed them and still have the problem. This machine runs other external applications from within this VB app with out any problems. Any Ideas?
0
Comment
Question by:hmauto
  • 3
  • 2
7 Comments
 
LVL 45

Assisted Solution

by:aikimark
aikimark earned 125 total points
ID: 39597093
Try this:
      cmndStr = Chr(34) & "\\hmnassrvr\HMNASSRVR_D\Applications\Scalper_Cycle_TM\Scalper Cycle TM.exe" & Chr(34)

Open in new window

0
 
LVL 46

Expert Comment

by:Martin Liss
ID: 39597650
Is the operating system different on the problem machine?
0
 

Author Comment

by:hmauto
ID: 39597729
No, all running on ether Windows 7 PRO or Windows 2008 server. I'm wondering if this could related to a screen resolution issue? The client I'm having the problem with is a lower resolution than all the others.
 aikimark: thanks for the suggestion but it didn't work.
0
Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

 
LVL 46

Accepted Solution

by:
Martin Liss earned 125 total points
ID: 39597765
Try having the client increase his screen resolution or have another client temporarily lower theirs.
0
 

Author Comment

by:hmauto
ID: 39598764
I'm pretty sure it's a problem with the application its self, because the Scalper Cycle TM.exe will not run directly on this client ether. So, I don't think it is a VB problem at all. Curious thing about it however, it runs on other clients. I can run this app just fine with the same resolution ( I tried your suggestion) on other clients without issue.  Anyway I'm getting different error messages running the app external to the VB, so maybe I can now come to a resolution.  
Thanks to everyone for there help. I'm going to close case.
0
 

Author Closing Comment

by:hmauto
ID: 39598775
Did not actually come to a solution to the problem, however experts trouble shooting suggestions were some help.
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

I was working on a PowerPoint add-in the other day and a client asked me "can you implement a feature which processes a chart when it's pasted into a slide from another deck?". It got me wondering how to hook into built-in ribbon events in Office.
Whether you’re a college noob or a soon-to-be pro, these tips are sure to help you in your journey to becoming a programming ninja and stand out from the crowd.
In this fourth video of the Xpdf series, we discuss and demonstrate the PDFinfo utility, which retrieves the contents of a PDF's Info Dictionary, as well as some other information, including the page count. We show how to isolate the page count in a…
In this seventh video of the Xpdf series, we discuss and demonstrate the PDFfonts utility, which lists all the fonts used in a PDF file. It does this via a command line interface, making it suitable for use in programs, scripts, batch files — any pl…

929 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

11 Experts available now in Live!

Get 1:1 Help Now