Force code to compile

G

Guest

Once a long time ago, Tom Ogilvy passed a short code to me that would
essentially simulate a click of the [Compile VBAProject] button in the VBE.
The objective is to force the code in the current module to (re)compile.

I didn't have any luck searching for it. Could someone (if not Tom) please
post this code again? Thanks.
 
T

Tom Ogilvy

How about:

thisworkbook.VBProject.VBE.CommandBars("Menu Bar"). _
controls("Debug").Controls("Compi&le VBAProject").Execute
 
G

Guest

That's the one! Thanks again Tom.

Tom Ogilvy said:
How about:

thisworkbook.VBProject.VBE.CommandBars("Menu Bar"). _
controls("Debug").Controls("Compi&le VBAProject").Execute

--
Regards,
Tom Ogilvy


quartz said:
Once a long time ago, Tom Ogilvy passed a short code to me that would
essentially simulate a click of the [Compile VBAProject] button in the VBE.
The objective is to force the code in the current module to (re)compile.

I didn't have any luck searching for it. Could someone (if not Tom) please
post this code again? Thanks.
 

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