Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

VB6 Runtime Error 5 When calling an external executable

Posted on 2013-10-23
7
Medium Priority
?
322 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 46

Assisted Solution

by:aikimark
aikimark earned 250 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 49

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
Industry Leaders: 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 49

Accepted Solution

by:
Martin Liss earned 250 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

Industry Leaders: 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

Whether you've completed a degree in computer sciences or you're a self-taught programmer, writing your first lines of code in the real world is always a challenge. Here are some of the most common pitfalls for new programmers.
Although it can be difficult to imagine, someday your child will have a career of his or her own. He or she will likely start a family, buy a home and start having their own children. So, while being a kid is still extremely important, it’s also …
Get people started with the process of using Access VBA to control Outlook using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Microsoft Outlook. Using automation, an Access applic…
Six Sigma Control Plans
Suggested Courses

604 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