Solved

VB6 Runtime Error 5 When calling an external executable

Posted on 2013-10-23
7
318 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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 47

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
Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
LVL 47

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

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
VB.net and sql server 4 54
Collapse and expand table in Word 2010 2 93
$_GET call between URL 3 38
Java List 4 33
Entering a date in Microsoft Access can be tricky. A typo can cause month and day to be shuffled, entering the day only causes an error, as does entering, say, day 31 in June. This article shows how an inputmask supported by code can help the user a…
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.
An introduction to basic programming syntax in Java by creating a simple program. Viewers can follow the tutorial as they create their first class in Java. Definitions and explanations about each element are given to help prepare viewers for future …

762 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