Visual Basic 6 Error

My vb6 program suddenly would not load.
Keeps giving two errors.

First:   Retained=0    suddenly I have a error with this file reference in vbp loading.  checked my backups from even a year ago and my vbp files always had it.     I REMOVED IT!

MultiUse = -1    gives a error message - Compile error: Invalid outside procedure

If I open vb6 first, then go to existing files and load its works.  Any idea what happened and how to fix short of reinstalling vb6, Thank You
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

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.

Martin LissOlder than dirtCommented:
The "Invalid outside procedure" means that you have something like this:

Option Explicit

MultiUse = -1

Private SomeSub()
End Sub

Open in new window

In other words the MultiUse = -1 line is not inside a procedure and it needs to be.

For the other error the VBP file may be referring to a different set of files than you refer to when you open VB6 first. To see if the VBP file refers to the right files, open it in notepad or some other editor and see if the file locations look OK.

You could also attach the files and I'll take a look at them

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
Retained = 0 is from a vb5 format vbp file, hence when you open it in vb6 it is not recognised.
TypingStarsAuthor Commented:
This is exactly what I have starting from the very top, but see bottom comment:

MultiUse = -1
Persistable = 0
DataBindingBehavior = 0
DataSourceBehavior  = 0
MTSTransactionMode = 0
Option Explicit
Public Function ......

Looking at a backup, Option Explicit was the top instruction. Do not know how the top section got there, so I'm commenting it out.

Retained =0 problem- when I click on the vbp file it by default is opening VB5 and was giving the Retained error.  Tried renaming DevSTudio folder and pointing vbp file to VB6, but it will not take.  Keeps loading it in Notepad even with me telling it VB6.exe for some reason.  Just going to load VB6 first to make sure I'm in the newest version.  Any last comments appreciated, Thanks
Martin LissOlder than dirtCommented:
You're welcome and I'm glad I was able to help.

In my profile you'll find links to some articles I've written that may interest you
including these two new ones.
Creating your own Excel Formulas and doing the impossible
A Guide to Writing Understandable and Maintainable VBA Code
Marty - MVP 2009 to 2015, Experts-Exchange Top Expert Visual Basic Classic 2012 to 2014
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.