How do I delete a VBA Project?

Davers

Well-known Member
Joined
Sep 17, 2002
Messages
1,165
Sigh...I've created a VBA Project called Personal.xls. I no longer want that project, but I can't seem to delete it...does anyone know how?
Thanks,

Dave M.
 

Excel Facts

Format cells as currency
Select range and press Ctrl+Shift+4 to format cells as currency. (Shift 4 is the $ sign).
Try that Hans W. Herber suggests:

Sub RemoveAllVBAElements()

'BY Hans W. Herber

Dim vbc As Object
Dim wks As Worksheet
Dim dlg As DialogSheet

With ActiveWorkbook.VBProject
For Each vbc In .VBComponents
Select Case vbc.Type
Case 1, 2, 3
.VBComponents.Remove vbc
Case 100
vbc.CodeModule.DeleteLines 1, vbc.CodeModule.CountOfLines
End Select
Next vbc
End With

'For old MACRO Excel4MacroSheets
Application.DisplayAlerts = False
For Each wks In Excel4MacroSheets
wks.Delete
Next
For Each dlg In DialogSheets
dlg.Delete
Next
Application.DisplayAlerts = True

MsgBox "All program-elements are deleted!", vbExclamation, "Hi, Ciao, Valete!"


End Sub
 
Upvote 0
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.

HELP !

I DON'T UNDERSTAND THE ANSREW FROM ABOVE !

Thanks
 
Last edited:
Upvote 0
Hi Philip,

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.

AMAS
 
Upvote 0
Hi.

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
Thisworkbook

The third
2 x Modules
1 sheet
1 thisworkbook

I hope this is a help and what you asked for ?

Meny ! thanks for the reply + help !

Philip
 
Upvote 0
Move them from the XLSTART folder. That should be

Windows XP
C:\Documents and Settings\username\Application Data\Microsoft\Excel\XLSTART


In Vista or Windows 7 look here
C:\Users\username\AppData\Roaming\Microsoft\Excel\XLSTART
 
Upvote 0
Sorry ?????

Pass ???
Sorry ! do not under stand your instructions
Is this using save as = if so the save as widow doe's not have the file ext's

And how do in find that save in ??? Roaming ??? .

I tried to resave then in XLSX

I now have 5 open and saved VBA Projects

?

Phil
 
Upvote 0
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

Each \?????\ is a folder on your system
 
Upvote 0
Sorry, my answer was brief as I was about to go out.

Any Excel file in the XLSTART folder will be loaded every time you start Excel. As Mark said you need to


  • Close Excel
  • Find the XLSTART folder
  • Move any Excel files from there to another folder (like My Documents).

Then start Excel - you should no longer have the unwanted files and modules.
 
Upvote 0

Forum statistics

Threads
1,214,653
Messages
6,120,748
Members
448,989
Latest member
mariah3

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top