Hi there
I need some help to this, please:
I have this workbook which is a master file and everytime I create a new file from, it deletes automatically the first sheet ("EnterOption") and a certain module ("Module11"). This works very fine.
For Module deletion I have this sub in another module:
[vba]Sub DeleteModule()
Dim VBComp As Object
Set VBComp = ActiveWorkbook.VBProject. _
VBComponents("Module11")
ActiveWorkbook.VBProject.VBComponents.Remove VBComp
End Sub[/vba]
However, when I open the new file, it gives a "Compile Error: Sub or function not defined" in ThisWorkbook Module.
I think this happens because in ThisWorkbook Module remains some references to the deleted sheet and module.
[vba]Private Sub Workbook_Open()
Worksheets("EnterOption").Activate
'This code goes in your ThisWorkbook Module
Call HideShowSheets("EnterOption", True)
End Sub[/vba]
So this sub is no longer needed. May I delete it in the same way I delete "Module11"? How do I pass over this issue?
Thanks
Ioncila