9 out of 10 times, the error message is misleading.
BEFORE you attempt to create the accDE, simply in the vba editor go debug->compile.
The above will show you your compile errors. Fix those, and you have no issues creating the accDE file.
So for 99% of cases, you can ignore that misleading message.
The simple issue is your VBA code has compile errors. You want to fix those errors before you distribute. In fact during development, you likely uses debug->compile 50 or 100 times a day. Get in the habit of doing this so your VBA code does not
“pile up” with a huge number of errors.
So it is a bad idea to try and run your application with compile errors. Simple get rid of all your VBA syntax errors, and ensure you can compile your code.
THEN and ONLY then should you attempt creating of an accDE.
Fix your compile errors as per above in the accDB. Once this is done, then the above “misleading” error message will go away and your be able to create the accDE without trouble.
It also rather un clear as to why you are creating a mde - for 2007 and beyond you should be creating a accDE - but fix any debug->compile error first. As noted, once done then creating the accDE should occur without issue. a "mde" goes
back to access 2003 - that is 13 years old!
Regards,
Albert D. Kallal (Access MVP, 2003-2017)
Edmonton, Alberta Canada