Page 1 of 2 12 LastLast
Results 1 to 10 of 13

Thread: VBA program always prompting to save .DVB on close

  1. #1
    Member
    Join Date
    2007-07
    Posts
    5
    Login to Give a bone
    0

    Question VBA program always prompting to save .DVB on close

    I have a VBA program that, as far as I can tell, has not given us this problem before, but now, with certain users, it always seems to prompt the user to save the .DVB file when AutoCAD is closed. The macro is loaded and runs without any known problems, but no changes are actually made to the VBA. But every time AutoCAD is closed, the prompt is given:

    "Do you want to save the changes you made to the VBA project "path...\Program.dvb"? (Yes) (Yes to All) (No) (Cancel)"

    We're running AutoCAD 2008, SP1. Can't recall if this problem was occurring before we upgraded from 2006, but it's possible.

    What settings, either in AutoCAD or in the VBA code might be causing this to happen? It's causing confusion among our users, and making it hard for us to debug issues when everybody has a different saved timestamp on their programming.

    Thanks!

  2. #2
    Active Member
    Join Date
    2008-02
    Location
    Central IL
    Posts
    53
    Login to Give a bone
    0

    Default Re: VBA program always prompting to save .DVB on close

    I had a similar problem in Inventor. Since I am the only one that does any programming, I set the read/write permissions in Windows such that I was the only one that had write access to the *.idv (the inventor *.dvb equivalent). This resolved the issue for me, and also helps keep the macro file from being inadvertently edited.

  3. #3
    All AUGI, all the time
    Join Date
    2003-10
    Posts
    706
    Login to Give a bone
    0

    Default Re: VBA program always prompting to save .DVB on close

    I just did a quick test to see what would happen if I opened the Visual Basic Editor and double clicked on one of the userforms in the project. Even without changing anything in the project but just clicking the userform from the Project Explorer, it prompts me to save the project when quiting AutoCAD. Are any of your people getting into the DVBs and clicking around but not changing anything?

  4. #4
    Member
    Join Date
    2007-07
    Posts
    5
    Login to Give a bone
    0

    Default Re: VBA program always prompting to save .DVB on close

    ed.w.cler: Unfortunately, that's not an option for us -- we have several people on our team who are in and out of the programs on a regular basis. Thanks for the tip, though, and I will keep it in mind.

    Coolmo, I don't think most of these users would know how to click around in the code. And on these particular machines, I was able to replicate the error simply by loading the macro and unloading it, without touching the editor. Most of our programs don't do this -- just one, and I don't think everyone is having the problem (if so, they haven't all reported it).

    Most of our macros are called from other macros... we frequently load and unload our DVB files from within other VBA code, and this one is no exception...

  5. #5
    Administrator rkmcswain's Avatar
    Join Date
    2004-09
    Location
    Earth
    Posts
    9,805
    Login to Give a bone
    0

    Default Re: VBA program always prompting to save .DVB on close

    For those people who DO get prompted, do they have proper rights to save the file in place? Are they saving it?
    R.K. McSwain | CAD Panacea |

  6. #6
    Administrator Ed Jobe's Avatar
    Join Date
    2000-11
    Location
    Turlock, CA
    Posts
    6,420
    Login to Give a bone
    0

    Default Re: VBA program always prompting to save .DVB on close

    Quote Originally Posted by amy.143074 View Post
    Most of our macros are called from other macros... we frequently load and unload our DVB files from within other VBA code, and this one is no exception...
    How? Does it involve using vbe? Are you setting references? Are you changing the code programatically?
    C:> ED WORKING....


    LinkedIn

  7. #7
    Member
    Join Date
    2007-07
    Posts
    5
    Login to Give a bone
    0

    Default Re: VBA program always prompting to save .DVB on close

    rkmcswain: They all have rights to save the VBA to the place they run it from. I have told them to click "No," I think occasionally they're clicking "Yes." Regardless of which selection they make, they get prompted again either way.

    In one case, when the prompt came up, I made a copy of the existing file before answering the prompt, and then selected "yes" and grabbed a copy of the resulting file (it does get saved, judging by the timestamp). Comparing the two, I couldn't notice any code differences, but the file size on the second file (after selecting "yes" to the prompt) is considerably larger in file size -- almost double.

    Ed Jobe: I use RunMacro (path & "Program.dvb!runThisMacro") and UnloadDVB(path & "Program.dvb") functions to run this vba. We do not programmatically modify the code, or at least not that I'm aware of. Didn't know that was possible.

    If I get a chance this afternoon, I'm going to try and find a way to more thoroughly compare the code between the two programs and try to spot any subtle differences. I don't expect to find any as far as code goes, but I'll update if I do.

  8. #8
    Administrator Ed Jobe's Avatar
    Join Date
    2000-11
    Location
    Turlock, CA
    Posts
    6,420
    Login to Give a bone
    0

    Default Re: VBA program always prompting to save .DVB on close

    Use WinDiff to compare them. Save the context of each to a txt file first. Windiff can't read the compiled dvb.
    C:> ED WORKING....


    LinkedIn

  9. #9
    All AUGI, all the time
    Join Date
    2003-10
    Posts
    706
    Login to Give a bone
    0

    Default Re: VBA program always prompting to save .DVB on close

    BTW, I've noticed that if I save a DVB file from my computer at work and then take it home to work on it from my laptop, the file size is wildly different even without changes to the code. I simply get into the code, don't change anything but still hit SAVE. When I take the DVB file back to work and copy it back to my work computer, it asks me to overwrite the file and shows different file sizes... sometimes almost double the original file size. Weird. I just assumed the different computers were saving it a different way.

  10. #10
    Administrator rkmcswain's Avatar
    Join Date
    2004-09
    Location
    Earth
    Posts
    9,805
    Login to Give a bone
    0

    Default Re: VBA program always prompting to save .DVB on close

    Quote Originally Posted by Coolmo View Post
    BTW, I've noticed that if I save a DVB file from my computer at work and then take it home to work on it from my laptop, the file size is wildly different even without changes to the code. I simply get into the code, don't change anything but still hit SAVE. When I take the DVB file back to work and copy it back to my work computer, it asks me to overwrite the file and shows different file sizes... sometimes almost double the original file size. Weird. I just assumed the different computers were saving it a different way.
    SAVE and SAVEAS are different in the VBA editor.
    SAVEAS also does sort of a "PURGE", resulting in a much smaller file usually.
    R.K. McSwain | CAD Panacea |

Page 1 of 2 12 LastLast

Similar Threads

  1. Save and Close Macro
    By mviall681618 in forum AutoLISP
    Replies: 7
    Last Post: 2015-04-25, 08:31 PM
  2. Close, relinquish, no save to central
    By ron.sanpedro in forum Revit - Worksharing/Worksets/Revit Server
    Replies: 22
    Last Post: 2007-09-12, 08:43 PM
  3. Close a file and don't save changes
    By jgardner.79905 in forum AutoLISP
    Replies: 4
    Last Post: 2006-08-21, 05:31 PM
  4. Replies: 16
    Last Post: 2006-06-26, 06:38 PM
  5. Unload DVB w/o prompting to save???
    By kdayman in forum VBA/COM Interop
    Replies: 0
    Last Post: 2006-03-24, 07:18 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •