VBA
Discuss AutoCAD ActiveX and VBA (Visual Basic for Applications) questions here.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

AutoCAD locks what are readonly .dvbs

13 REPLIES 13
Reply
Message 1 of 14
aseidel
675 Views, 13 Replies

AutoCAD locks what are readonly .dvbs

We keep .dvbs on a network in a readonly directory. Even as such these files cannot be modified when loaded by someone and, since it seems that a dvb cannot unload itself, editing the dvbs while in use requires saving to a temporary dvb file. It there a way around this?
13 REPLIES 13
Message 2 of 14
Anonymous
in reply to: aseidel

No unless you wait till everyone goes home. -- Mike ___________________________ Mike Tuersley CADalyst's CAD Clinic Rand IMAGINiT Technologies ___________________________ the trick is to realize that there is no spoon...
Message 3 of 14
Anonymous
in reply to: aseidel

The way I've gotten around this is to unload the app when it's done. ThisDrawing.SendCommand "_vbaunload" & vbCr & """Filename.dvb""" & vbCr Hope this helps. -- I support two teams: the Red Sox and whoever beats the Yankees. "Mike Tuersley" wrote in message news:i5vl39icrg5l.18e5r5oqrk6nw$.dlg@40tude.net... | No unless you wait till everyone goes home. | -- Mike | ___________________________ | Mike Tuersley | CADalyst's CAD Clinic | Rand IMAGINiT Technologies | ___________________________ | the trick is to realize that there is no spoon...
Message 4 of 14
Anonymous
in reply to: aseidel

You could just use Application.UnloadDVB "Filename.dvb" instead. ~Tim Riley "Matt W" wrote in message news:41595774$1_1@newsprd01... > The way I've gotten around this is to unload the app when it's done. > > ThisDrawing.SendCommand "_vbaunload" & vbCr & """Filename.dvb""" & vbCr > > > Hope this helps. > > -- > I support two teams: the Red Sox and whoever beats the Yankees. > > > "Mike Tuersley" wrote in message > news:i5vl39icrg5l.18e5r5oqrk6nw$.dlg@40tude.net... > | No unless you wait till everyone goes home. > | -- Mike > | ___________________________ > | Mike Tuersley > | CADalyst's CAD Clinic > | Rand IMAGINiT Technologies > | ___________________________ > | the trick is to realize that there is no spoon... > >
Message 5 of 14
aseidel
in reply to: aseidel

I've tried these before without success, but I see now that
they only work when "filename.dvb"is "fullpath/filename.dvb".

The Application.UnloadDVB works buts generates
an "execution error" message. The SendCommand method
does not generate an error message. I've used these as the
last line in the userform terminate event.

Thanks
Message 6 of 14
Anonymous
in reply to: aseidel

Whether you unload or not, its still not a fix because you have no control over someone accessing the file while you're in it. The only safe way is to work on a copy of the dvb. -- Mike ___________________________ Mike Tuersley CADalyst's CAD Clinic Rand IMAGINiT Technologies ___________________________ the trick is to realize that there is no spoon...
Message 7 of 14
Anonymous
in reply to: aseidel

What I've done with other "critical" files is to create an INI file on the network and the user's hard drive. Every time AutoCAD starts up, both INI files are checked. If one section of the user's INI file does not match the same section of the INI file on the network, the "critical" file on the user's hard drive is deleted, the one from the network is downloaded to the user's HD, then the INI file on the user's HD is updated to match the one on the network. Works like a charm every time! -- I support two teams: the Red Sox and whoever beats the Yankees. "Mike Tuersley" wrote in message news:l6an1kzjh9tv$.xvnjjax6lwfo.dlg@40tude.net... | Whether you unload or not, its still not a fix because you have no control | over someone accessing the file while you're in it. The only safe way is to | work on a copy of the dvb. | | -- Mike | ___________________________ | Mike Tuersley | CADalyst's CAD Clinic | Rand IMAGINiT Technologies | ___________________________ | the trick is to realize that there is no spoon...
Message 8 of 14
Anonymous
in reply to: aseidel

Nice approach Matt! -- Mike ___________________________ Mike Tuersley CADalyst's CAD Clinic Rand IMAGINiT Technologies ___________________________ the trick is to realize that there is no spoon...
Message 9 of 14
Anonymous
in reply to: aseidel

Thanks. I use DosLib to read/write the INI files. DosLib makes it really easy, and like I said, it works EVERY time! :) -- I support two teams: the Red Sox and whoever beats the Yankees. "Mike Tuersley" wrote in message news:xpx0fymd1i9f$.1l0n1u0qv7r4a$.dlg@40tude.net... | Nice approach Matt! | | -- Mike | ___________________________ | Mike Tuersley | CADalyst's CAD Clinic | Rand IMAGINiT Technologies | ___________________________ | the trick is to realize that there is no spoon...
Message 10 of 14
aseidel
in reply to: aseidel

I think the auto-unload would work most of the time. The VBA's are usually modal forms and so they would be unloaded when dismissed. The downside is a slightly longer load time. The auto-unload could be removed once the VBA is past the point where a tweek is unlikely.

Is there a way for the VBA to know its fullpath name? The unload command requires the fullpath name. I want to avoid hardcoding the fullpath name.
Message 11 of 14
Anonymous
in reply to: aseidel

Here you go... Debug.Print Application.VBE.ActiveVBProject.FileName -- I support two teams: the Red Sox and whoever beats the Yankees. "AKS" wrote in message news:5845362.1096480564137.JavaMail.jive@jiveforum2.autodesk.com... |I think the auto-unload would work most of the time. The VBA's are usually modal forms and so they would be unloaded when dismissed. The downside is a slightly longer load time. The auto-unload could be removed once the VBA is past the point where a tweek is unlikely. | | Is there a way for the VBA to know its fullpath name? The unload command requires the fullpath name. I want to avoid hardcoding the fullpath name.
Message 12 of 14
aseidel
in reply to: aseidel

Thanks Matt. I use the Object Browser as a guide to see what is available. That item is not listed.
Message 13 of 14
NathTay
in reply to: aseidel

Add a reference to "Microsoft Visual Basic for Applications Extensibility 5.3"
Regards - Nathan
Message 14 of 14
Anonymous
in reply to: aseidel

"Nathan Taylor" wrote in message news:29237348.1096932104896.JavaMail.jive@jiveforum2.autodesk.com... > Add a reference to "Microsoft Visual Basic for Applications Extensibility > 5.3" > Regards - Nathan

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Autodesk Design & Make Report

”Boost