VBA Compile Error - Invalid Outside Procedure - Solution

Steven Cohen

New Member
Joined
Jul 6, 2016
Messages
26
Hi All

To prevent this problem from happening always remember to password protect your code!

Go to:
Alt+F11
Tools
VBA Project - Project Properties
Protection
tick Lock project for viewing
insert a Password

After sitting with a situation where I couldn't find an answer for on any forums (maybe my search was not accurate enough) I finally found the answer to my problem.

The problem presented itself on one of my projects that someone else was using and they couldn't give me enough information as to what the problem was. Every time the project was opening, it was giving the error "Invalid Outside Procedure"

It turns out someone managed to open the code and accidentally typed in some random numbers and letters into the area above one of the subs and it prevented the entire project from running correctly.

I have since learned from my mistake of not protecting my code and I just wanted to share this with everyone who might have this issue along the line.
 

Excel Facts

Why does 9 mean SUM in SUBTOTAL?
It is because Sum is the 9th alphabetically in Average, Count, CountA, Max, Min, Product, StDev.S, StDev.P, Sum, VAR.S, VAR.P.

Forum statistics

Threads
1,215,066
Messages
6,122,948
Members
449,095
Latest member
nmaske

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top