Check if VBA Project is loaded...

Check if VBA Project is loaded...

Anonymous
Not applicable
482 Views
2 Replies
Message 1 of 3

Check if VBA Project is loaded...

Anonymous
Not applicable
Is there any way to check (in AutoLISP)
what (if any) VBA project is loaded?

Basically I'm using AutoLISP to initialize
my VBA App. and it works fine
in AutoCAD 2000i with
(command "-vbarun" path!project.module.macro)

however in AutoCAD R14 (& 14.01)
which are also being used to run the App.
cannot use this syntax. it can only use
module.macro

It's great in AutoCAD 2000i because the
command loads and runs the App.
but in AutoCAD 14 (& 14.01) you have to load
the project first...

How do I check to see if the project is already loaded?
(In AutoLISP)

TIA

Thomas Smith
0 Likes
483 Views
2 Replies
Replies (2)
Message 2 of 3

Anonymous
Not applicable
Put this function in a VB ActiveX DLL and you can call it from VL.

Public Function GetVBAProjects() As Variant

Dim i As Long, projects() As String
Dim objIDE As VBIDE.vbe

Set objIDE = Application.vbe

ReDim projects(0 To objIDE.VBProjects.Count - 1, 1)

For i = 0 To objIDE.VBProjects.Count - 1
projects(i, 0) = objIDE.VBProjects(i + 1).Name
projects(i, 1) = objIDE.VBProjects(i + 1).BuildFileName
Next

GetVBAProjects = projects

End Function

Joe

"Thomas Smith" wrote in message
news:30A1BEB71C948CBF94613EE9E8DB24A3@in.WebX.maYIadrTaRb...
> Is there any way to check (in AutoLISP)
> what (if any) VBA project is loaded?
>
> Basically I'm using AutoLISP to initialize
> my VBA App. and it works fine
> in AutoCAD 2000i with
> (command "-vbarun" path!project.module.macro)
>
> however in AutoCAD R14 (& 14.01)
> which are also being used to run the App.
> cannot use this syntax. it can only use
> module.macro
>
> It's great in AutoCAD 2000i because the
> command loads and runs the App.
> but in AutoCAD 14 (& 14.01) you have to load
> the project first...
>
> How do I check to see if the project is already loaded?
> (In AutoLISP)
>
> TIA
>
> Thomas Smith
>
>
0 Likes
Message 3 of 3

Anonymous
Not applicable
Correct me if I'm wrong, but don't you have to have
Visal Lisp installed to use any of the VL functions?

I'll be using this App. in R14 & R14.01
Niether of which have VL included...
How do I get around this?

And wouldn't that function only work for Acad 2000?
From what I understand, Acad R14 cannot have multiple
projects loaded?

"Joe Sutphin" wrote in message
news:A84D3968D4D285DC4F5328F270112F24@in.WebX.maYIadrTaRb...
> Put this function in a VB ActiveX DLL and you can call it from VL.
>
> Public Function GetVBAProjects() As Variant
>
> Dim i As Long, projects() As String
> Dim objIDE As VBIDE.vbe
>
> Set objIDE = Application.vbe
>
> ReDim projects(0 To objIDE.VBProjects.Count - 1, 1)
>
> For i = 0 To objIDE.VBProjects.Count - 1
> projects(i, 0) = objIDE.VBProjects(i + 1).Name
> projects(i, 1) = objIDE.VBProjects(i + 1).BuildFileName
> Next
>
> GetVBAProjects = projects
>
> End Function
>
> Joe
>
> "Thomas Smith" wrote in message
> news:30A1BEB71C948CBF94613EE9E8DB24A3@in.WebX.maYIadrTaRb...
> > Is there any way to check (in AutoLISP)
> > what (if any) VBA project is loaded?
> >
> > Basically I'm using AutoLISP to initialize
> > my VBA App. and it works fine
> > in AutoCAD 2000i with
> > (command "-vbarun" path!project.module.macro)
> >
> > however in AutoCAD R14 (& 14.01)
> > which are also being used to run the App.
> > cannot use this syntax. it can only use
> > module.macro
> >
> > It's great in AutoCAD 2000i because the
> > command loads and runs the App.
> > but in AutoCAD 14 (& 14.01) you have to load
> > the project first...
> >
> > How do I check to see if the project is already loaded?
> > (In AutoLISP)
> >
> > TIA
> >
> > Thomas Smith
> >
> >
>
>
0 Likes