# Can't Delete Macro



## xandermom (Aug 9, 2005)

Hello all...

I added a Macro a while ago to help me grade papers and now want to delete it. I go into Tools//Macro/Macros and can see the macro but the delete button isn't highlighted. I cannot seem to figure out how to delete this macro no matter what I do. 

Help!

Thanks...


----------



## Jimmy the Hand (Jul 28, 2006)

Go to Tools/Macro/Visual Basic Editor.
Top left window contains objects, where macros can be placed on, in a tree structure.
As you didn't say which application it is, I pick Excel. The said objects usually are worksheets and modules. Custom recorded macros are placed into macro modules. If you doubleclick on Module1, the corresponding code page will be opened in the big window to the right. If there are more modules, check each one until you find your macro amond the code lines. It looks like

```
Sub MacroName
   ...
   (macro code)
   ...
End Sub
```
Delete this block as if in text editor, and you delete the macro.
In Word, it is almost the same, except you have ThisDocument instead of worksheets. And also you have the Normal.dot template, which, beside ThisDocument, is another place to store macros in.


----------



## xandermom (Aug 9, 2005)

Thank you so much for your help. The Macro is in Word. I have tried to do as you suggested. On the visual basic screen I can see a tree which includes the Macro I am attempting to delete, but when I click on it I receive an error message stating: "Project is Unviewable". Any suggestions? Thanks again...


----------



## Jimmy the Hand (Jul 28, 2006)

Try this
http://experts.about.com/q/Microsoft-Word-1058/Word-Edit-macro.htm

If it doesn't work, tell me where is the macro in the tree structure.


----------



## xandermom (Aug 9, 2005)

Jimmy the Hand said:


> Try this
> http://experts.about.com/q/Microsoft-Word-1058/Word-Edit-macro.htm
> 
> If it doesn't work, tell me where is the macro in the tree structure.


Hi - I'm so frustrated. I did as you suggested and get the "Project Locked - Project Unviewable" error message. So if there is a password am I stuck with this macro forever?? In the tree structure the macro is the first one listed. Under the macro I'm trying to delete is a macro called Normal, and then one called Project 1. Thank you so much for your help. I am having nothing but computer problems in the last few days!
Michelle


----------



## Jimmy the Hand (Jul 28, 2006)

The "Normal" you see in the upper left window is the base template of Word, called "Normal.dot". The "Project" is the Word document you are currently editing. If the macro is somewhere on the "Normal" branch, it means it is saved into the Normal.dot template. Many a problem in Word can be cured by deleting the Normal.dot. Try this:
Close Microsoft Word. Look for the file "Normal.dot". It should be in the folder
*C:\Documents and Settings\Username\Application Data\Microsoft\Templates*
Rename it to a random filename, e.g. "aaaa.txt"
Open Word again. It will create a new Normal.dot template, without the macro. If there's no problem with the new template, you can delete the renamed old one ("aaaa.txt"). Remember that with this move you delete every macro that was recorded or written into the Normal.dot. Check each part of the Normal branch in Visual Basic Editor if there are other macros. If there are (and you need them), copy them to a textfile, and paste them back to the new teplate once it is created by Word.


----------



## xandermom (Aug 9, 2005)

Jimmy the Hand said:


> The "Normal" you see in the upper left window is the base template of Word, called "Normal.dot". The "Project" is the Word document you are currently editing. If the macro is somewhere on the "Normal" branch, it means it is saved into the Normal.dot template. Many a problem in Word can be cured by deleting the Normal.dot. Try this:
> Close Microsoft Word. Look for the file "Normal.dot". It should be in the folder
> *C:\Documents and Settings\Username\Application Data\Microsoft\Templates*
> Rename it to a random filename, e.g. "aaaa.txt"
> Open Word again. It will create a new Normal.dot template, without the macro. If there's no problem with the new template, you can delete the renamed old one ("aaaa.txt"). Remember that with this move you delete every macro that was recorded or written into the Normal.dot. Check each part of the Normal branch in Visual Basic Editor if there are other macros. If there are (and you need them), copy them to a textfile, and paste them back to the new teplate once it is created by Word.


Well, I tried this and it didn't work and I think that is because the macro I'm attempting to delete isn't a part of Normal. It is listed above Normal.dot as a separate macro.

I wish I could do a screen shot, but it looks something like this:

+ CorrectingProject (Correcting_jmm)
+ Normal
- Project (Document 1)

I am attempting to delete the Correcting Project macro.

Is it hopeless? Again thank you for all of your help. I am just so tired of the dialoge box asking me if I want to enable the macros every time I open Word...

Thanks again...

Michelle


----------



## xandermom (Aug 9, 2005)

xandermom said:


> Well, I tried this and it didn't work and I think that is because the macro I'm attempting to delete isn't a part of Normal. It is listed above Normal.dot as a separate macro.
> 
> I wish I could do a screen shot, but it looks something like this:
> 
> ...


I think I found a way around the irritating message. I increased the security level for running Macros to Very High so this macro won't run. So if for whatever reason I can't delete it, at least now I won't be as aware that it is there!

Michelle


----------



## Anne Troy (Feb 14, 1999)

Hi, Michelle. Try the instructions here:
http://www.officearticles.com/excel/remove_vba_code_from_a_workbook_in_microsoft_excel.htm

Doing it in Excel is VERY similar to Word. 

If you still can't get rid of it, try saving the file as RTF, close and reopen. RTF isn't capable of storing macros.


----------



## GaryMN (Sep 5, 2013)

This replies to an old thread that is closed. But I doubt the problem has gone away.

I had macros that could not be deleted. When you tried to delete them in the Visual Basic editor or drop down menus they were not highlighted or otherwise not reachable. You would get a message "Project is Unviewable".

I started clicking around in Word, in the Templates and Add-ins menu, and was eventually able to delete various entries left from some programs--HotDocs and some pdf thing. This seemed to be the thing that helped most. I also deleted some Hotdocs .dot documents from the Startup folder and cleaned out the registry.

Hope this works for you!

Gary


----------

