PDA

View Full Version : VBA within the Startup Suite


Paul_Cadtastic
06-03-2007, 10:26 AM
Hi all.

I have a vba project that is required to be included in the startup suite. The only problem is that this is not always loaded on start up. AutoCAD cannot seem to load this code whilst starting up.

I have seen some options to edit the local acad.lsp files which may be the route I need to take in order to get some consistency in loading, however if there is a fix out there to this problem then your input would be greatly received.

:nowork:

Paul_Cadtastic
06-03-2007, 10:43 AM
Hi.

Simple answer is to point the support path to your routines folder and then create an acad.dvb file that contains the following:

---------------------------------------------------------------------

Dim strAddModDel As String

Public Sub ACADStartup()

' Start VBA and check toolbar
Dim FileName As String
FileName = "\\<SERVER>\<SHARE>\<FILENAME>.dvb"

' Load a sample VBA project DVB file
LoadDVB FileName

On Error GoTo errorhandler
Call AcadApplication.RunMacro(FileName & "!Initialize")
Exit Sub
errorhandler:


End Sub

---------------------------------------------------------------------

Obviously substituting the SERVER SHARE AND FILENAME with your own values.

:Welcome:

Cad_Monkey
07-12-2008, 10:37 PM
It's also good to have the VBA to initialise with AutoCAD. To do so create a Acad.rx and include any required .arx files

The VBA "ARX" file is

"acvba.arx"

These will be initialise with the opening of AutoCAD which if you have any file support pathing set within my Acad.dvb so it is advisable to have that run with the opening of AutoCAD.

http://www.afralisp.net/lisp/custom.htm

Has more details with regards to Customisable AutoCAD loaded files.