compile error: invlaid outside procedure

B

brinded

I had a macro setup to open new word documents in 'online view' with a
few other settings. It's worked fine for years. Now it seems to have
been corrupted. When I hit cmd-n I get a box saying, "compile error:
invlaid outside procedure."

The same message comes up when I try to delete or edit macros.

Any ideas/thoughts?

Thanks, dg
 
J

John McGhie

Where's the yellow line?

The compiler will stop with the error highlighted (in this case, it will
highlight the name of the procedure). The error should be obvious if you
examine the code.

Pay particular attention to the nesting of Sub... And End Sub statements,
and make sure you have not inadvertently commented one out.

Are you translating from a different language? I have never seen that
SPECIFIC error, and I do a lot of VBA...

Cheers


I had a macro setup to open new word documents in 'online view' with a
few other settings. It's worked fine for years. Now it seems to have
been corrupted. When I hit cmd-n I get a box saying, "compile error:
invlaid outside procedure."

The same message comes up when I try to delete or edit macros.

Any ideas/thoughts?

Thanks, dg

--
Don't wait for your answer, click here: http://www.word.mvps.org/

Please reply in the group. Please do NOT email me unless I ask you to.

John McGhie, Consultant Technical Writer
McGhie Information Engineering Pty Ltd
http://jgmcghie.fastmail.com.au/
Sydney, Australia. S33°53'34.20 E151°14'54.50
+61 4 1209 1410, mailto:[email protected]
 
B

brinded

John, thanks for the response. Trouble is, I can't open the editor. It
will allow me to create a new macro, in fact I have made a couple of
test macros in an effort to troubleshoot. However, if I list macros,
and then select 'edit' (or 'delete'), it gives the pop-up message
"compile error: invalid outside procedure." Same as I get when I hit
cmd-n.

Could this be a virus? It seemed to happen spontaneously, I hadn't
been doing anything unusual at the time, i.e. I wasn't in the process
of creating a macro (I haven't done that in about a year). Maybe I
inadvertently hit a combination of keys? (My typing is lousy). I don't
know.
 
B

brinded

I think I've found it - I restarted and the application opened in VBE.
At the top of the list of my macros was some stray text - I deleted it
- and now it seems to be working fine. Thanks again for your effort -
much appreciated.
 
J

John McGhie

Yep: You've got it :)

I'm a crap typist too, but that's one I have never done to myself.

I could give you a long list of the ones I HAVE done.... :)

Cheers


I think I've found it - I restarted and the application opened in VBE.
At the top of the list of my macros was some stray text - I deleted it
- and now it seems to be working fine. Thanks again for your effort -
much appreciated.

--
Don't wait for your answer, click here: http://www.word.mvps.org/

Please reply in the group. Please do NOT email me unless I ask you to.

John McGhie, Consultant Technical Writer
McGhie Information Engineering Pty Ltd
http://jgmcghie.fastmail.com.au/
Sydney, Australia. S33°53'34.20 E151°14'54.50
+61 4 1209 1410, mailto:[email protected]
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top