I would like to comment the lines who contains Msg Box from another code VBA. I'm trying this with the Library VBA EXTENSIBILITY but i doesn't found the solution.
Any help is welcome.
This is my code:
Sub CommentCode()
Dim VBProj As VBIDE.VBProject
Dim VBComp As VBIDE.VBComponent
Dim CodeMod As VBIDE.CodeModule
Dim LineNum As Long
Const QUOTE = '
Set VBProj = ActiveWorkbook.VBProject
Set VBComp = VBProj.VBComponents("ThisWorkbook")
Set CodeMod = VBComp.CodeModule
With CodeMod
LineNum = .CreateEventProc("Open", "Workbook")
LineNum = LineNum + 1
.InsertLines LineNum, QUOTE
End With
End Sub