PDA

View Full Version : [SOLVED:] Suddenly can't do anything in VBA ?? "Access is denied" ??



ashleyuk1984
04-15-2014, 01:14 PM
Well, I'm not quite sure what's happened tonight. I was playing around in VBA, went to have something to eat, came back, tried to design a simple userform, and was halted with an error ??
For instance, I'm try to place a button onto the userform from the toolbox and I get this message.

http://www.ultraimg.com/images/pEUs7.png

Help takes me to this URL:
http://msdn.microsoft.com/en-US/library/dd831853(v=vs.120).aspx

I've tried uninstalling Office completely and reinstalled. But I still get the same error when trying to design a userform.

Modules seem to be OK...
Has anyone experienced this error before?? I've been search Google for answers, but can't find anything ??

Thanks

Simon Lloyd
04-15-2014, 01:21 PM
You haven't protected the project in any way have you?, is there an add-in running that could be causing it? also check to see that your VBA project doesn't have a broken reference. Go to Tools > References, and check that none are marked "MISSING".

ashleyuk1984
04-15-2014, 01:59 PM
No I haven't protected the project.
This problem happens with newly created projects.

None of my standard references are "missing".

This is my references list:

http://www.ultraimg.com/images/JevBp.png

These are my Add-ins:
Doesn't look like I've got anything troublesome

http://www.ultraimg.com/images/5DGLP.png

I just can't work out what's causing it?

Aflatoon
04-15-2014, 02:57 PM
Have you rebooted your computer? Assuming you have, search for .exd (NOT .exe!) files on the C: drive and delete them (with all Office apps closed) then try again.

ashleyuk1984
04-15-2014, 03:19 PM
Yeah I've rebooted a couple of times since it started happening.
I've searched for .exd files on the C: drive. I've found one called: MSComctLib.exd, located in "C:\Users\Ashley\AppData\Roaming\Microsoft\Forms"

Firstly, I made a backup (but renamed the extension to .bakexd

Tried creating a userform, still got the error.
So I deleted the file (sent it to recycle bin), tried again, and still got the error. :(

Aflatoon
04-16-2014, 01:07 AM
I would expect there to be more .exd files if you've used userforms in Excel before.

Aussiebear
04-16-2014, 01:36 AM
Have you tried to restore your system to an earlier date? Just in case you created something "less than wonderful" when playing around in vba earlier.

mancubus
04-16-2014, 01:44 AM
checking tmp/temp folders for the existence of exd files will be of help too.

in such cases, i close all applications, open windows explorer, navigate to these folders and delete all temps where possible.

ashleyuk1984
04-16-2014, 03:55 AM
I used my work computer to search for more *.exd files, as I use VBA there as well.
I found another folder, and another file called:

MSForms.exd
inside the C:\Users... AppData\Local\Temp\VBE folder.

I then navigated to this folder on my home PC (the computer with the problem), and I found this file. I deleted that file, and now I'm able to create userforms again, and place buttons etc without any problems.

I have no idea why this file prevented me from doing it before, but I'm glad that it's now fixed.

Thank you to all that helped!!