Table of contents
Collapse the table of content
Expand the table of content

CodeModule Object (VBA Add-In Object Model)

office 365 dev account|Last Updated: 6/12/2017
1 Contributor

Represents the code behind a component, such as a form, class, or document. Remarks You use the CodeModule object to modify (add, delete, or edit) the code associated with a component. Each component is associated with one CodeModule object. However, a CodeModule object can be associated with multiplecode panes. The methods associated with the CodeModule object enable you to manipulate and return information about the code text on a line-by-line basis. For example, you can use the AddFromString method to add text to themodule. AddFromString places the text just above the firstprocedure in the module or places the text at the end of the module if there are no procedures. Use the Parent property to return the VBComponent object associated with acode module.

© 2018 Microsoft