P
Paul Watkins
I Have this piece of code that will transfer a Macro from One Book to
another Book (Book1.xls).
Book1.xls will then be closed.
ThisWorkbook.VBProject.VBComponents("Module1").Export "macro1.bas"
Workbooks("Book1.xls").VBProject.VBComponents.Import "macro1.bas"
Kill "macro1.bas"
At this point, Book1.xls has 1 module in it and no code under 'ThisWorkbook'
When I re-open 'Book1.xls' I need that macro to run automatically.
Normally this could be done by writing this line in 'ThisWorkbook'
Private Sub Workbook_Open()
Call macro1
End Sub
How do i get the above code into the microsoft excel object ' ThisWorkbook'
so that my macro will run automatically
Paul
(Getting more confused by the minute )
another Book (Book1.xls).
Book1.xls will then be closed.
ThisWorkbook.VBProject.VBComponents("Module1").Export "macro1.bas"
Workbooks("Book1.xls").VBProject.VBComponents.Import "macro1.bas"
Kill "macro1.bas"
At this point, Book1.xls has 1 module in it and no code under 'ThisWorkbook'
When I re-open 'Book1.xls' I need that macro to run automatically.
Normally this could be done by writing this line in 'ThisWorkbook'
Private Sub Workbook_Open()
Call macro1
End Sub
How do i get the above code into the microsoft excel object ' ThisWorkbook'
so that my macro will run automatically
Paul
(Getting more confused by the minute )