Yes Ed, both the drawing and acad.dvb are in the same folder. the acad.dvb is having a sub routine in module1 called acadstartup (). The acad.dvb is getting loaded, fine. But the sub routine acadstartup is not running as a startup routine. My code looks some thing like this...
Code:
Sub AcadStartup()
Dim Fs As Object
Set Fs = CreateObject("scripting.filesystemobject")
Dim eCount As Integer
eCount = 0
Dim ACADPref As AcadPreferencesProfiles
Dim SourceProfile As String, DestinationProfile As String
Set ACADPref = ThisDrawing.Application.preferences.Profiles
On Error GoTo ERRORTRAP1
SourceProfile = "<<Unnamed Profile>>"
DestinationProfile = "ACAD2004_WP_KOC_R1"
ACADPref.CopyProfile SourceProfile, DestinationProfile
ACADPref.ActiveProfile = DestinationProfile
.........
end sub
My intention is that when the user opens the drawing, this code should automatically get executed and set some preferences like profile, support file search path and a user menu.
I tried to embed the dvb into the drawing also, but I need to initialize any of the VBA command, then AutoCAD prompts, "Initializing VBA system....." , then my code get executed, then the VBA command I invoked works (for example, VBAman), then AutoCAD prompts "Loading VBA startup file...". I am confused with the sequence of execution. Hope this gives you a clear picture...
Many thanks,
Abdul