I'm developing some VBA macros in Autocad. The built-in editor is obsolete, but I wasn't able to find any better way to edit the .dvb
files.
A .dvb
file does contains many other source files packed in, and so far I think that Autocad is the only software that can unpack them...
The only way it seems to be able to do this, is to export every file from the .dvb
manually; but since I have about 30 files there, it doesn't seem like this is a good way to do things.
Any ideas on how to do this better?
You can export all your files with this code :
Public Sub Export()
Dim vbe As vbe
Set vbe = ThisDrawing.Application.vbe
Dim comp As VBComponent
Dim outDir As String
outDir = "C:\\Temp\\VbaOutput"
If Dir(outDir, vbDirectory) = "" Then
MkDir outDir
End If
For Each comp In vbe.ActiveVBProject.VBComponents
Select Case comp.Type
Case vbext_ct_StdModule
comp.Export outDir & "\" & comp.Name & ".bas"
Case vbext_ct_Document, vbext_ct_ClassModule
comp.Export outDir & "\" & comp.Name & ".cls"
Case vbext_ct_MSForm
comp.Export outDir & "\" & comp.Name & ".frm"
Case Else
comp.Export outDir & "\" & comp.Name
End Select
Next comp
MsgBox "VBA files were exported to : " & outDir
End Sub
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With