Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Remove a Module with Code 1

Status
Not open for further replies.

Storyteller

Instructor
Apr 19, 1999
343
CA
Hello All,
How would I remove a Module (without saving) with code. I've gotten as far as

Application.VBE.VBProjects.Remove

The prompt for Remove is lpc as VBProject
Of course the computer I am currently on does not have the VBA help installed :-(

The reason for this is that I would like to delete the module before emaillng the workbook.

Any help would be greatly appreicated.

Regards,
Michael
 
Hello Fred,
Thanks for the quick reply.
I followed the link and copied and pasted the code into a module. When I ran the code it gave me the following error:

VBComp As VBComponent "User-Defined Type not Defined"

But I think this will give me something to work with.

Thanks.
 
Hello Fred,
Of course the code works ;-) I forgot to read the information at the beginning.

"Before using these procedures, you'll need to set a reference in VBA to the VBA Extensibility library. In the VBA editor, go to the Tools menu, choose the References item, and put a check next to "Microsoft Visual Basic For Applications Extensibility" library."

After I set the reference the code examples worked.

Once again thanks.

Michael
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top