Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Deleting Code in 'ThisWorkbook'
After creating a report, I use the following to delete all the code in the
main module before passing it along: Sub DeleteAllCodeInModule() Dim VBCodeMod As CodeModule Dim StartLine As Long Dim HowManyLines As Long Set VBCodeMod = ThisWorkbook.VBProject.VBComponents("Module3").Cod eModule With VBCodeMod StartLine = 1 HowManyLines = .CountOfLines .DeleteLines StartLine, HowManyLines End With End Sub Now I realize I need to also delete all the code that executes when the workbook is first opened. How can I modify the code above to delete the lines of code in ThisWorkbook? |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
2007 View Code ThisWorkbook | Excel Discussion (Misc queries) | |||
Stop execution of ThisWorkBook Code | Excel Programming | |||
Importing Code into 'ThisWorkbook' | Excel Programming | |||
Delete the code in ThisWorkbook | Excel Programming | |||
Code in ThisWorkbook crashes Excel | Excel Programming |