VB Runtime Error 50003

I can't seem to get my application to run on any other machine (except the development machine) because of a Unexpected runtime error.  Basically, it willl display the splash screen, the error comes up "vb runtime error 50003, unexpected error", and the user is forced to quit.  I have analyzed my ocx's and files distributed with my app, maybe I am missing something.  Here is the code where the error is occuring.

Sub Main()
    On Error GoTo BSS_ErrorHandler
    Load FrmIntro
    Unload frmSplash
Exit Sub


    If Err.Number > 0 Then ProjectErrorHandler "(Module) Module1::Sub Main"
    Resume Next
End Sub

Please help with any guidance, I am at my last wit.  
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Check this microsoft Page...


FIX: "Unexpected Error" Message When Loading a GIF

You can't run any code in the form you're unloading after the unload statement. Try reversing the unload line with the frmintro.show line.
Unless ern314 is performing DoEvents in the load event of the splash screen, theres nothing wrong with where ern314 is unloading the splash screen... the Load event of the splash screen will fire and run and return without a problem.
The Ultimate Tool Kit for Technolgy Solution Provi

Broken down into practical pointers and step-by-step instructions, the IT Service Excellence Tool Kit delivers expert advice for technology solution providers. Get your free copy for valuable how-to assets including sample agreements, checklists, flowcharts, and more!

mcrider, the splash screen shows fine so I don't understand why you've locked the question with that comment. Actually I do understand why, but let's not get into that now.

ern314, it's quite difficult for us here to work out what could be wrong with your application. As far as I can tell from what you're saying, there's nothing wrong with your code, otherwise it couldn't have run on your development machine.

That leaves the possibility that your installation is not correct. How do you get the application on to your users' PCs? Did you create a setup program with the Setup Wizard (VB5) or the Package and Deployment Wizard (VB6)? Or did you use a product such as InstallShield to create your setup?

If you did use the VB wizard, did it at any time complain about missing dependency information or stuff like that, and did you ignore the warning?

If you didn't use the VB wizard, perhaps you could use the VB wizard just to create a dependency (.dep) file; the .dep file is basically just a text file. It may be a bit weird and wonderful, but it's readable. It would tell you what OCX, DLL and other files your application depends on. You must make sure that you include all these files in your setup.

It could also depend on the platform on which you're installing the software. For example, if you developed the software on a Windows NT platform, I would recommend that if your users have Windows NT as well, they should make sure they're on the same Win NT service pack as yourself. If your users happen to have VB on their machines, their VB installations should be on the same service pack as yourself. For both VB5 and 6, I think the recommended service pack to be on is SP3. Some of VB5's OO stuff doesn't work properly in earlier service packs, I don't know what's wrong with VB6 pre ITS service pack 3.

If your user installs your application on a Windows NT machine they should be logged on to the machine with administrator privileges to the machine so the installation procedure will be able to overwrite and register all the OCX and DLL files.

Your user should not have any other applications running whilst installing your program to avoid the chance of having files that should be replaced locked. Virus checkers can be naughty in that respect.

If you did not use any software to create an installation or setup pack, I strongly recommend you start using some.

That's all I can think of wrt causing your problem. I hope some of it helps.

Good luck


Other comments from "Accepted Answers":

From: JoeyT Date: Friday, June 04 1999 - 03:48AM IST  
The problem is definately a .OCX version conflict.  I had a similar case with it. What I did was put the old .OCX back on the "original" computer, re-open and complie the program again.  Re-create the .EXE and replace the .EXE on the computer at your friends house that doesn't work.  This would probably be the easiest way.  
Accepted Answer
From: cukaj Date: Tuesday, July 27 1999 - 09:36AM IST  
It is something to do with a wrong version of an OCX. Check which OCXs are you using on the form that is giving the 50003 runtime error. Then copy these OCXs from the development PC to the non development machine in the Windows/System folder. We have encountered this problem with the comdlg32.ocx and this was the only procedure that we found to make it work
ern314Author Commented:
mcrider, sorry but the solution provided by microsoft is no good.  I am not loading any gifs, nor do I have any picture objects in my application.  However, CUKAJ, JOEY T, and Pino might be on to something.  Here's the lowdown: I compiled my app and created a setup for my app using VB5 app setup wizard, now when I ran it, the wizard indicated that "no dependency information was available to locate the dependant automation component....msword8.olb must be added manually".  So, naturally, I add the file, other than that there are no other apparent errors with the setup.  Now, I developed this app on an NT machine with SP3, and the machines on which I setup the app are the same os config.  I will try the ocx solution
This error could be caused by a couple of reasons... but the most logical one is An ActiveX control created in Visual Basic contains font properties. When this control is used in a Web authoring environment, such as FrontPage or the ActiveX Control Pad, the Web authoring environment crashes or produces the following error:
Run-time error '50003':
Unexpected Error

ern314Author Commented:
Okay, Thank you all for your interesting and helpful solutions, it turns out the the ocx was the problem.  For some reason, the target machine would not register the ocx's copied to it from the setup program.  I really would like to find another way out of distributing my exe and ocx's separately, mainly because this app is going be distributed to about 50+ users.  But i can live with an inch for now.  The points should go to CUKAJ her solution solved the problem asap.  Thanks guys for your help you don't know how much time I have been spared.  

This is why I answer questions instead of leaving a comment when the answer is a possible "real answer"... See http://www.experts-exchange.com/jsp/qShow.jsp?ta=visualbasic&qid=10225206 

 As for my answer, the Microsoft article clearly states:

"It is important to note that this error is somewhat of a "catch-all" error that can be generated under other circumstances completely unrelated to the use of GIF files. The purpose of this article is to provide details regarding one particular set of circumstances where this error may arise."


Hi ern314,

In this case you can follow the following courses of action

1 If you feel cukaj should get some points, you could post a dummy question titled "points for cukaj". When cukaj notices the question, cukaj can lock it and you can accept the answer. You still accept my answer for this question.

2 You could also decide to "Split points". In that case you will have to ask customer service to delete this question, because you can't reduce the number of points allocated to it. When customer service deletes the question, your original 150 points will be refunded. You can then post TWO dummy questions, "X points for caraf_g" and "Y points for cukaj".

3 Finally, you could decide not to give me any points, and give all the points to cukaj, but I think that would be a bit unfair since I put in the research that found the solution for you.


Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
mcrider - If you had read the question properly you would have realised that the splash screen shows fine before the program crashes, and therefore it can't possibly be caused by your suggestion. It was therefore wholly inappropriate for you to lock the question with your "answer".

It has already been pointed out to you how locking questions with inappropriate answers can adversely affect an asker's chance of getting a helpful response, so I won't repeat the arguments as they are obviously falling on deaf ears.

It turns out that is is an OCX problem, however, this is not to say that the answer I gave could not have solved the problem... For example, the description of the problem says that the splash screen shows and that "Load FrmIntro" does not happen and a vb runtime error 50003 occurs.

If the form FrmIntro contained an image that tried to show a GIF file that does not specifically contain an Image Object, Then you would receive the error 50003.

I've said all I have to say, let's keep the remainder of this discussion where it belongs.
ern314Author Commented:
Honestly, guys it is okay.  I am a happy lark... CARAF_G, I am sorry, I previously neglected to recognize your contribution to the solution. Thank you.
I really appreciate it.
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Visual Basic Classic

From novice to tech pro — start learning today.