AutoCAD prompts to save changes to .dvb project on exit even though nothing has changed

AutoCAD prompts to save changes to .dvb project on exit even though nothing has changed

carlos.riosHZ78K
Explorer Explorer
786 Views
8 Replies
Message 1 of 9

AutoCAD prompts to save changes to .dvb project on exit even though nothing has changed

carlos.riosHZ78K
Explorer
Explorer

Hello,

 

Upon exiting the application, I always get prompted to save changes to my .dvb project even though I haven't changed any of the VBA code or even opened the VBA IDE. How can I make it stop asking me every time my application exits?

 

carlosriosHZ78K_0-1699635289019.png

 

 

Thanks,

0 Likes
787 Views
8 Replies
Replies (8)
Message 2 of 9

norman.yuan
Mentor
Mentor

The VBA project (DVB file) probably was created from older version of AutoCAD, for example, it was last changed and save with Acad2020 or earlier version. Now you use it in Acad2021 or later (the COM API version is the same from Acad2021 to 2024). So, if you open the project in VBA IDE, its reference to Acad type library could be automatically updated, thus the prompt for saving.

 

If you expect all users of the VBA project are using Acad2021 or later, you should do the saving on the prompt once for all. But if the users use both older and newer AutoCAD (before  and after Acad2021), you may want to keep 2 versions of the project with different name, such as with suffix "xxxxx_2020.dvb", or "xxxxx_2021.dvb".

Norman Yuan

Drive CAD With Code

EESignature

Message 3 of 9

carlos.riosHZ78K
Explorer
Explorer

Ah, I see. I was trying to remove the AutoCAD 2021 type library reference since all future users will be using the AutoCAD 2023 version, but it won't let me since it's currently in use. Is there a fast way to switch the reference library to autocad 2023? Or would that require re-writing the entire .dvb project?

0 Likes
Message 4 of 9

norman.yuan
Mentor
Mentor

As I already stated, from AutoCAD2021 to 2024, the COM API versions are the same: Acad2021 type library. So, you do not try to remove Acad2021 type library when the VBA project is used in AutoCAD 2022/2023/2024. That is, Acad2021 to 2024 has the same COM API version (2021 version).

 

Norman Yuan

Drive CAD With Code

EESignature

0 Likes
Message 5 of 9

carlos.riosHZ78K
Explorer
Explorer

Okay, then regarding your original post - even if I press 'Yes' and save my changes on AutoCAD 2023 once and for all it will still ask me again next time that I exit the application. Is there a way to make it not ask me again?

0 Likes
Message 6 of 9

norman.yuan
Mentor
Mentor

How do you load the DVB file? are you sure when AutoCAD run, the loaded DVB file (manually or automatically loaded) is the newly saved one? To confirm it, you can save the DVB file to somewhere; then run AutoCAD, enter command VBAMAN, and unload the DVB file, and click the button "Load" to manually load the newly saved DVB file, to see if the saving prompt still pops up or not.

 

Norman Yuan

Drive CAD With Code

EESignature

0 Likes
Message 7 of 9

carlos.riosHZ78K
Explorer
Explorer

In the past, I knew that it was using the saved updated version given that the date modified of the .dvb file changed every time I exit the application and pressed "Yes" to save the changes.

 

I just tried the method you outlined, and the problem still persists. Not sure what to try next.

0 Likes
Message 8 of 9

norman.yuan
Mentor
Mentor

Well, it is not very clear to me: do you have this prompt issue always, or only recently (after you upgrade AutoCAD to newer version)?

 

if it is former, then there could be another possibility: the VBA project has reference to "Microsoft Visual Basic for Application Extensibility 5.x" library, and the VBA code in the VBA project uses the API in that library to modify the project itself every time the VBA project is loaded, thus the saving prompt.

 

You can go into VBA IDE, click menu "Tools->References..." to see if that library is referenced:

normanyuan_1-1699662678512.png

Or, you can open "Object Browser" to see if that library is used:

normanyuan_2-1699662789987.png

 

If the VBA Extensibility is indeed used, you might be able to find out what the VBA code is doing with it. But whatever it does, it makes changes to the VBA project, thus you get the prompt. IMO, in most cases, using VBA Extensibility is bad choice and unnecessary. But that is the case with your VBA project, you either live with the annoying prompt (but user really do not need to save the change), or update the VBA code to get rid of the use of it, or simply throw the VBA project away and find a good replacement.

 

 

 

Norman Yuan

Drive CAD With Code

EESignature

0 Likes
Message 9 of 9

carlos.riosHZ78K
Explorer
Explorer

Looks like these are the references being used:

 

carlosriosHZ78K_1-1699899815838.png

 

And this is what is being showed on the object browser:

 

carlosriosHZ78K_2-1699899859982.png

So I'm not sure if that applies to my project. I guess based on your message I should just leave the issue alone and have the popup keep re-appearing? Since discarding the project is not an option. Thanks for your help, I appreciate it!

 

0 Likes