D
Danny
Hi,
I found the Create Event Procedure macro below from Mr. Chip Pearson's
website that is very helpful to my project.
Dim StartLine As Long
With ActiveWorkbook.VBProject.VBComponents("ThisWorkbook").CodeModule
StartLine = .CreateEventProc("Open", "Workbook") + 1
.InsertLines StartLine, _
"Msgbox ""Hello World"",vbOkOnly"
End With
However, the macro won't work if the VBA is protected.
Is there a way that the macro above be edited to unprotect the VBA (say
password is "ABCD"), then, the above macro will run, then, the VBA will be
protected with the same password?
Thank you.
I found the Create Event Procedure macro below from Mr. Chip Pearson's
website that is very helpful to my project.
Dim StartLine As Long
With ActiveWorkbook.VBProject.VBComponents("ThisWorkbook").CodeModule
StartLine = .CreateEventProc("Open", "Workbook") + 1
.InsertLines StartLine, _
"Msgbox ""Hello World"",vbOkOnly"
End With
However, the macro won't work if the VBA is protected.
Is there a way that the macro above be edited to unprotect the VBA (say
password is "ABCD"), then, the above macro will run, then, the VBA will be
protected with the same password?
Thank you.