Eng-Tips is the largest engineering community on the Internet

Intelligent Work Forums for Engineering Professionals

VBA program setup disk creation

Status
Not open for further replies.

SunnyShine

Structural
Jan 25, 2000
17
0
0
IN
I have developed a VBA program to work in AutoCAD 2000.  How can I create a setup program to install the routine in AutoCAD with necessary button menus.
 
Replies continue below

Recommended for you

As far as I know, VBA does not support making stand alone applications or Set-up disks. You are going to need VB instead of VBA to be able to do this.
 
I don't know for sure but all office applications support VBA as add-ins maybe Autocad can do that to...

If that works you can add the neccesary menu's with some kind of auto_open macro in this add-in.

Hope this helps!

Jonathan
 
I ran into a situation like this with my own project. The problem was that the only previous way to get macros installed was to manually import it from a file (what are the odds regular users can do this?). After some snooping, I found out that any file located in the directory:

C:\Program Files\Microsoft Office\Office\XLStart
(or whatever your installation path is for Office)

would automatically be included when Excel started up. So all we did was copy the PERSONAL.XLS file, rename it (with the included macros) and created an .EXE file (using WinZip) that would install it in the proper path. I don't know if AutoCAD 2000 has a directory like this, but you might try to do some checking. You might be able adapt this solution to your own problem.
 
I'll outline how I make a installer for an Excel Add-in - this might give you ideas for your own problem:

Let's say the name of the add-in file is 'MyAddin.xla' and the installer is called 'MyAddinInstall.xls'

In the 'ThisWorkbook' module of MyAddinInstall, write the following code:

Private Sub Workbook_Open()
FileToInstall = ThisWorkbook.Path + "\MyAddin.xla"
Set MyAddin = AddIns.Add(FileName:=FileToInstall, CopyFile:=True)
MyAddin.Installed = True
MsgBox ("The MyAddin Add-in is now installed." + Chr(10) + "Excel will now close." + Chr(10) + "The Add-in will now auto-load every time you start Excel." + Chr(10) + "Uninstall with Tools>Addins & deselect the MyAddin check-box.")
Application.Quit
End Sub

For this to work, both the installer AND the Addin must e in the same directory. Note that the addin will be copied to the addins folder only when the installer is on a removable medium, say a floppy. If both the files are on your hard drive, the add-in will be installed but will NOT be copied to the add-ins directory - it'll be accessed straight from its current location.

Hope this helps.
 
Status
Not open for further replies.
Back
Top