petsiye
Altın Üye
- Katılım
- 28 Eylül 2009
- Mesajlar
- 193
- Excel Vers. ve Dili
- Office 2019 TR 32 Bit
- Altın Üyelik Bitiş Tarihi
- 10-05-2029
Merhaba,
Bu kıymetli web sitesi sayesinde aşağıdaki VBA Koduna ulaştım. Kod sorunsuz görevini yapıyor, yani benim istediğim Modülleri siliyor ve Excel dosyasını kaydediyor. Fakat sorun şu. Dosyayı kapattıktan sonra, sildiğine bizzat şahit olduğum modüller, ben dosyayı yeniden açınca tekrar geri geliyor. Acaba sebebi ne olabilir ?
Yardım ve desteğiniz için şimdiden Teşekkür Ederim
Sub Delete_Module()
On Error Resume Next
Set VBEref = Application.VBE.ActiveVBProject.VBComponents
For Each VBComponent In VBEref
If VBComponent.Name = "Module1" Then
VBEref.Remove VBComponent
End If
If VBComponent.Name = "Module2" Then
VBEref.Remove VBComponent
End If
If VBComponent.Name = "Module7" Then
VBEref.Remove VBComponent
End If
If VBComponent.Name = "Module41" Then
VBEref.Remove VBComponent
End If
If VBComponent.Name = "Module50" Then
VBEref.Remove VBComponent
End If
If VBComponent.Name = "Module9" Then
VBEref.Remove VBComponent
End If
If VBComponent.Name = "Module48" Then
VBEref.Remove VBComponent
End If
If VBComponent.Name = "Module55" Then
VBEref.Remove VBComponent
End If
If VBComponent.Name = "Module49" Then
VBEref.Remove VBComponent
End If
If VBComponent.Name = "Module60" Then
VBEref.Remove VBComponent
End If
If VBComponent.Name = "Module5" Then
VBEref.Remove VBComponent
End If
If VBComponent.Name = "Module30" Then
VBEref.Remove VBComponent
End If
If VBComponent.Name = "Module6" Then
VBEref.Remove VBComponent
End If
If VBComponent.Name = "Module57" Then
VBEref.Remove VBComponent
End If
Next
ActiveWorkbook.Save
End Sub
Bu kıymetli web sitesi sayesinde aşağıdaki VBA Koduna ulaştım. Kod sorunsuz görevini yapıyor, yani benim istediğim Modülleri siliyor ve Excel dosyasını kaydediyor. Fakat sorun şu. Dosyayı kapattıktan sonra, sildiğine bizzat şahit olduğum modüller, ben dosyayı yeniden açınca tekrar geri geliyor. Acaba sebebi ne olabilir ?
Yardım ve desteğiniz için şimdiden Teşekkür Ederim
Sub Delete_Module()
On Error Resume Next
Set VBEref = Application.VBE.ActiveVBProject.VBComponents
For Each VBComponent In VBEref
If VBComponent.Name = "Module1" Then
VBEref.Remove VBComponent
End If
If VBComponent.Name = "Module2" Then
VBEref.Remove VBComponent
End If
If VBComponent.Name = "Module7" Then
VBEref.Remove VBComponent
End If
If VBComponent.Name = "Module41" Then
VBEref.Remove VBComponent
End If
If VBComponent.Name = "Module50" Then
VBEref.Remove VBComponent
End If
If VBComponent.Name = "Module9" Then
VBEref.Remove VBComponent
End If
If VBComponent.Name = "Module48" Then
VBEref.Remove VBComponent
End If
If VBComponent.Name = "Module55" Then
VBEref.Remove VBComponent
End If
If VBComponent.Name = "Module49" Then
VBEref.Remove VBComponent
End If
If VBComponent.Name = "Module60" Then
VBEref.Remove VBComponent
End If
If VBComponent.Name = "Module5" Then
VBEref.Remove VBComponent
End If
If VBComponent.Name = "Module30" Then
VBEref.Remove VBComponent
End If
If VBComponent.Name = "Module6" Then
VBEref.Remove VBComponent
End If
If VBComponent.Name = "Module57" Then
VBEref.Remove VBComponent
End If
Next
ActiveWorkbook.Save
End Sub