XL2003 - ThisWorkbook.VBProject.VBComponents("ThisWorkbook").CodeModule

P

PCLIVE

I have the following code that removes some lines from "ThisWorkbook". This
seems to work fine from Excel 2000 and Excel 2002. However, it does not
seem to work from Excel 2003. Is there any reason why this wouldn't work on
Excell 2003 or later?

Set CodeMod =
ThisWorkbook.VBProject.VBComponents("ThisWorkbook").CodeModule
With CodeMod
StartLine = .ProcStartLine("Workbook_Open", vbext_pk_Proc)
ProcLen = .ProcCountLines("Workbook_Open", vbext_pk_Proc)
.DeleteLines StartLine, ProcLen
End With


Thanks in advance,
Paul
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top