Executing VBA-routine from VB6

Executing VBA-routine from VB6

Anonymous
Not applicable
193 Views
2 Replies
Message 1 of 3

Executing VBA-routine from VB6

Anonymous
Not applicable
Hello

I am trying to run a VBA-routine in AutoCAD 2000, from VB6
The RunMacro command could be used, but the tricky part, is that I want VB6
to continue.
The RunMacro does not continue until the Macro has been finished.

AcadApp.RunMacro ("j:\cadserver\cadserver.dvb!OpenDwg.xxx")
Do
DoEvents
If Timer - AcadTime > ErrorWait# Then
ErrorMsg$ = "Error when running Macro-job in AutoCAD"
ErrorFlag% = 1
exit do
End If
Loop While Dir$(JobFile$) <> ""

Any suggestions to how I can trigger OpenDwg.xxx, and continue in VB6??
NOT 'sendcommand', because this requires an open drawing.

Kind regards

Michael Christoffersen
3DI
0 Likes
194 Views
2 Replies
Replies (2)
Message 2 of 3

Anonymous
Not applicable
Why not just move the VBA code into your VB project? Then RunMacro won't be an
issue.

--
http://www.acadx.com
Win a free autographed copy of
"AutoCAD 2000 VBA Programmer's Reference"

"Michael Christoffersen" wrote in message
news:04D67591BCADFF89CA2971533B6C475C@in.WebX.maYIadrTaRb...
> Hello
>
> I am trying to run a VBA-routine in AutoCAD 2000, from VB6
> The RunMacro command could be used, but the tricky part, is that I want VB6
> to continue.
> The RunMacro does not continue until the Macro has been finished.
>
> AcadApp.RunMacro ("j:\cadserver\cadserver.dvb!OpenDwg.xxx")
> Do
> DoEvents
> If Timer - AcadTime > ErrorWait# Then
> ErrorMsg$ = "Error when running Macro-job in AutoCAD"
> ErrorFlag% = 1
> exit do
> End If
> Loop While Dir$(JobFile$) <> ""
>
> Any suggestions to how I can trigger OpenDwg.xxx, and continue in VB6??
> NOT 'sendcommand', because this requires an open drawing.
>
> Kind regards
>
> Michael Christoffersen
> 3DI
>
0 Likes
Message 3 of 3

Anonymous
Not applicable
I have thought about that solution. However another company makes the VBA
and I just need to activate it.

Michael

"Frank Oquendo" wrote in message
news:CEADE5BC4342BCEA8C5BA1CF3D29C9C1@in.WebX.maYIadrTaRb...
> Why not just move the VBA code into your VB project? Then RunMacro won't
be an
> issue.
>
> --
> http://www.acadx.com
> Win a free autographed copy of
> "AutoCAD 2000 VBA Programmer's Reference"
>
> "Michael Christoffersen" wrote in message
> news:04D67591BCADFF89CA2971533B6C475C@in.WebX.maYIadrTaRb...
> > Hello
> >
> > I am trying to run a VBA-routine in AutoCAD 2000, from VB6
> > The RunMacro command could be used, but the tricky part, is that I want
VB6
> > to continue.
> > The RunMacro does not continue until the Macro has been finished.
> >
> > AcadApp.RunMacro ("j:\cadserver\cadserver.dvb!OpenDwg.xxx")
> > Do
> > DoEvents
> > If Timer - AcadTime > ErrorWait# Then
> > ErrorMsg$ = "Error when running Macro-job in AutoCAD"
> > ErrorFlag% = 1
> > exit do
> > End If
> > Loop While Dir$(JobFile$) <> ""
> >
> > Any suggestions to how I can trigger OpenDwg.xxx, and continue in VB6??
> > NOT 'sendcommand', because this requires an open drawing.
> >
> > Kind regards
> >
> > Michael Christoffersen
> > 3DI
> >
>
0 Likes