Hi,
I open the Project workbook, and when conditions are met, a copy
of that workbook is made (UserWkbk).
So I now have two workbooks open.
The Project workbook code then calls the following sub:
Sub DeleteModule(UserWkbk As Workbook)
Dim VBProj As VBIDE.VBProject
Dim VBComp As VBIDE.VBComponent
With UserWkbk
Set VBProj = UserWkbk.VBProject
Set VBComp = VBProj.VBComponents _
("InitialiseOnOpenWorkbook")
VBProj.VBComponents.Remove VBComp
End With
End Sub
I'm getting a subscript out of range error msg on the line:
Set VBComp .....
Can you help, please ?
Bookmarks