Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
deleting userform or VBA modules by makro
For security reasons (unwanted use of self made program)
I want to delete a selfmade Userform(FrmEsti) and a Module in a pasword protected VBAProject named (Est.xls), first I have allready removed some sheets as follows : Sheets(Array("Text", "Data")).Select Application.DisplayAlerts = False ActiveWindow.SelectedSheets.Delete ActiveWorkbook.Save Application.DisplayAlerts = True ActiveWorkbook.Close Can I do a simular thing with a complete VBAproject or only the Forms and/or Modules before saving the file ??? Many thanks for a not to complicated solution... I'm only a homemade programmer. Kind regards, pat |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
deleting userform or VBA modules by makro
Pat,
This is how to delete a userform module Dim VBComp As Object Set VBComp = ThisWorkbook.VBProject.VBComponents("Userform1") ThisWorkbook.VBProject.VBComponents.Remove VBComp -- HTH RP (remove nothere from the email address if mailing direct) "pat (belgium)" wrote in message ... For security reasons (unwanted use of self made program) I want to delete a selfmade Userform(FrmEsti) and a Module in a pasword protected VBAProject named (Est.xls), first I have allready removed some sheets as follows : Sheets(Array("Text", "Data")).Select Application.DisplayAlerts = False ActiveWindow.SelectedSheets.Delete ActiveWorkbook.Save Application.DisplayAlerts = True ActiveWorkbook.Close Can I do a simular thing with a complete VBAproject or only the Forms and/or Modules before saving the file ??? Many thanks for a not to complicated solution... I'm only a homemade programmer. Kind regards, pat |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
deleting userform or VBA modules by makro
-----Original Message----- Pat, This is how to delete a userform module Dim VBComp As Object Set VBComp = ThisWorkbook.VBProject.VBComponents ("Userform1") ThisWorkbook.VBProject.VBComponents.Remove VBComp -- HTH Many thanks, your tip works super... :-) RP (remove nothere from the email address if mailing direct) "pat (belgium)" wrote in message ... For security reasons (unwanted use of self made program) I want to delete a selfmade Userform(FrmEsti) and a Module in a pasword protected VBAProject named (Est.xls), first I have allready removed some sheets as follows : Sheets(Array("Text", "Data")).Select Application.DisplayAlerts = False ActiveWindow.SelectedSheets.Delete ActiveWorkbook.Save Application.DisplayAlerts = True ActiveWorkbook.Close Can I do a simular thing with a complete VBAproject or only the Forms and/or Modules before saving the file ??? Many thanks for a not to complicated solution... I'm only a homemade programmer. Kind regards, pat . |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Deleting blank modules | Excel Discussion (Misc queries) | |||
Deleting modules in XLA | Excel Programming | |||
When to code in sheet or userform modules and when to use modules | Excel Programming | |||
old makro (excel 95) should work with vba-modules | Excel Programming | |||
No success deleting modules | Excel Programming |