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 strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

ThisWorkbook 1

Status
Not open for further replies.

WaterSprite

Technical User
Mar 23, 2004
69
US
Is there a way to progmatically enter code into the "ThisWorkbook" module. Instead of typing Macro30 in the module, or doing a manual copy and paste, can I write code that will do so.

Or, is there code that handles the COMMENT BLOCK, UNCOMMENT BLOCK.
 
You need a reference to 'Microsoft Visual Basic for Applications Extensibility 5.3' and programmatic access to vba project (xp+ versions). Example of programmatic access to the code:
Code:
With ThisWorkbook.VBProject.VBComponents("ThisWorkbook").CodeModule
    MsgBox .Lines(1, .CountOfLines)
End With

combo
 
Thanks for the tip. I figured out a different solution to the problem I had. However, the library thing is something I need to check out with my computer at work. Thanks again.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top