Dim vbc As Object
Dim wks As Worksheet
Dim dlg As DialogSheet
For Each vbc In .VBComponents
Select Case vbc.Type
Case 1, 2, 3
vbc.CodeModule.DeleteLines 1, vbc.CodeModule.CountOfLines
'For old MACRO Excel4MacroSheets
Application.DisplayAlerts = False
For Each wks In Excel4MacroSheets
For Each dlg In DialogSheets
Application.DisplayAlerts = True
MsgBox "All program-elements are deleted!", vbExclamation, "Hi, Ciao, Valete!"
Please can some kind person explane how to remove / delete an VBA Project.
I have axidently create 3 projecks / work books ?
How I do not know ?
Now when I open the Excel programe using the Icon form the tool bar ( Widows 7 ) I open all three projects = I don,t want them at all !
I click on the Visual Basic button in the Deleveloper tab and get a window = Microsoft Visual Basic - (name of work book ) .xlsb
In the left side = Project - VBA Project.
I have clicked on one of the ( files / work books ) in the list / in the following window the remove tab is not high lighted ???
Please ! Please ansrew in an or with plain instructions ! I have never used VBA projects and most proberly never again.
Dumb question, but does your file have an extension of .xlsm? If so then you can just save it an .xlsx extension which can not contain macros. It will give you a warning about this when you come to change file extensions.
I hope this helps and apologize if I didn't understand you question completely.
As I said I have three VBA work books that open when I click on the Excel icon.
( they are not in any file = in order to open as a file on its own or to bealbe to delete ) ?
When open I open the Developer tab. far left of the tool bar = Visual Basic icon. New window, far left again = 3 project
1st VBAProject (Makcro.xlsb)
2nd VBAProject (Makcro.xlsm)
3rd VBAProject (personal,XLSB)
The first two have the following once the Plus sign has been opened
3 x Modules
up to sheet 3
Phillip you are mis-understanding what Peter is sugggesting you do. Forget Excel(you can close it). He is telling you to( depending on how old your windows version is) either click the start button, then computer then the folders
Local disk C:\Users\username\AppData\Roaming\Microsoft\Excel\XLSTART or
My Computer then
Local disk C:\Users\username\AppData\Roaming\Microsoft\Excel\XLSTART