I am using cpearsons code to copy modules from one workbook to another workbook. But I am unsucessful to copy codes associated with workbook_open event or workbook_beforesave event. Can anyone help me out in this.
Following code from
is being used
The following procedure will copy Module1 from Book2 to Book1.
Sub CopyOneModule() Dim FName As String With Workbooks("Book2") FName = .Path & "\code.txt" .VBProject.VBComponents("Module1").Export FName End With Workbooks("book1").VBProject.VBComponents.Import FName End Sub
I want to copy codes associated with workbook events from Book2 to Book1. Can anyone please help me in this?