Hi,
I'm trying to remove a module in excel, but i keep getting errors (438). The code I'm using is:
Workbooks(Books_to_do(1)).VBProject.VBComponents(4).Remove
But I've also tried:
Set Old_project = Workbooks(Books_to_do1)).
VBProject.VBComponents(Sheets(I).Name)
Old_project.remove
And:
For Each M In Workbooks(Books_to_do1)).
VBProject.VBComponents
If M.Type = 1 Then
If M.Name = Sheets(I).Name Then
M.Remove
End If
End If
Next
I hope there's someone that can help me with this.
Agathe
I'm trying to remove a module in excel, but i keep getting errors (438). The code I'm using is:
Workbooks(Books_to_do(1)).VBProject.VBComponents(4).Remove
But I've also tried:
Set Old_project = Workbooks(Books_to_do1)).
VBProject.VBComponents(Sheets(I).Name)
Old_project.remove
And:
For Each M In Workbooks(Books_to_do1)).
VBProject.VBComponents
If M.Type = 1 Then
If M.Name = Sheets(I).Name Then
M.Remove
End If
End If
Next
I hope there's someone that can help me with this.
Agathe