Running a vba routine

Running a vba routine

Anonymous
Not applicable
355 Views
11 Replies
Message 1 of 12

Running a vba routine

Anonymous
Not applicable
I developed a vba application that I want to be executed via a lisp
function. The application is loaded at startup via the acad.lsp file
and I define a routine in the acaddoc.lsp file which actually runs the
routine. The code to define the routine to run the macro is as follows:

(defun c:ll ()
(command "-vbarun" "Label_Manager.mdlRunLMan.LabelMan_Play") ; run
labelmanager
(princ) ; clean exit
)

When I run the program via the lisp command (typing ll at command
prompt) the program works correctly except for the fact that after it
has ended autocad reports back "Execution Error" at the command line.
If I run the routine manually by typing VBARUN at the comand prompt and
running it via the dialog box, I do not recieve the error message. Other
than the error message being routined, the programs operation is
correct.

Idea's??

Thanks,

Ryan

--
Ryan Small
Solid Caddgroup Inc. - Burlington, Ontario
Authorized Autodesk Systems Center
Ph: (905)331-9670, Fx: (905)331-7280
ryan@solidcadcam.com
http://www.solidcadcam.com
0 Likes
356 Views
11 Replies
Replies (11)
Message 2 of 12

Anonymous
Not applicable
Hi Ryan,

I don't know if it's the only cause, but an un-needed/un-wanted "End"
statement in the program will cause that message.

Gary
0 Likes
Message 3 of 12

Anonymous
Not applicable
Thanks Gary, that did it.

Much appreciated, Ryan

Gary McMaster wrote:
>
> Hi Ryan,
>
> I don't know if it's the only cause, but an un-needed/un-wanted "End"
> statement in the program will cause that message.
>
> Gary

--
Ryan Small
Solid Caddgroup Inc. - Burlington, Ontario
Authorized Autodesk Systems Center
Ph: (905)331-9670, Fx: (905)331-7280
ryan@solidcadcam.com
http://www.solidcadcam.com
0 Likes
Message 4 of 12

Anonymous
Not applicable
Glad it helped. I wish I knew why it does that.

Gary
0 Likes
Message 5 of 12

Anonymous
Not applicable
Mabe you can help me. I get the same "Execution error" message with an
unwanted End statemtnet to close out my application but if I take it out and
just use an "unload me" the my form seems to re-initialize everytime i hit
my cancel button. and End is the only way i have found to break the cycle.
what is possibly causing it not to unload the form?

"Gary McMaster" wrote in message
news:f0322d5.2@WebX.maYIadrTaRb...
> Glad it helped. I wish I knew why it does that.
>
> Gary
>
0 Likes
Message 6 of 12

Anonymous
Not applicable
Patrick,

That's when I first ran into the problem, placing an "End" in the "Cancel"
or "Exit" button. I've never heard of the Unload.Me problem before. Have you
tried using Unload.FormName instead of .Me? I don't know if it will work,
but it's easy enough to try. Could another form have the focus and the Me
keyword is referencing the other form?

Gary
0 Likes
Message 7 of 12

Anonymous
Not applicable
There is only one form in the project and i tried to unload formname as well
with the same results. My program seems to execute ok it is just that i know
that error message means something is going wrong, but i cant figure out
what.

"Gary McMaster" wrote in message
news:99E23495B4BB62ECE908B8FDAB184AFA@in.WebX.maYIadrTaRb...
> Patrick,
>
> That's when I first ran into the problem, placing an "End" in the "Cancel"
> or "Exit" button. I've never heard of the Unload.Me problem before. Have
you
> tried using Unload.FormName instead of .Me? I don't know if it will work,
> but it's easy enough to try. Could another form have the focus and the Me
> keyword is referencing the other form?
>
> Gary
>
0 Likes
Message 8 of 12

Anonymous
Not applicable
Use Me.Hide instead of End before unloading
-Josh

Patrick Porter wrote:

> There is only one form in the project and i tried to unload formname as well
> with the same results. My program seems to execute ok it is just that i know
> that error message means something is going wrong, but i cant figure out
> what.
>
> "Gary McMaster" wrote in message
> news:99E23495B4BB62ECE908B8FDAB184AFA@in.WebX.maYIadrTaRb...
> > Patrick,
> >
> > That's when I first ran into the problem, placing an "End" in the "Cancel"
> > or "Exit" button. I've never heard of the Unload.Me problem before. Have
> you
> > tried using Unload.FormName instead of .Me? I don't know if it will work,
> > but it's easy enough to try. Could another form have the focus and the Me
> > keyword is referencing the other form?
> >
> > Gary
> >
0 Likes
Message 9 of 12

Anonymous
Not applicable
On Thu, 8 Mar 2001 08:43:01 -0800, "Patrick Porter"
wrote:

»Mabe you can help me. I get the same "Execution error" message with an
»unwanted End statemtnet to close out my application but if I take it out and
»just use an "unload me" the my form seems to re-initialize everytime i hit
»my cancel button. and End is the only way i have found to break the cycle.
»what is possibly causing it not to unload the form?

Do you have any code in the unload event of the form or an active
timer that would cause the form to reload?

--
Paul Marshall
pmarshal@vulcraft-al.com
0 Likes
Message 10 of 12

Anonymous
Not applicable
no code at all just an End

"Paul Marshall" wrote in message
news:fjjhat4lno5cnoj92c3k9bdf62o36cc835@4ax.com...
> On Thu, 8 Mar 2001 08:43:01 -0800, "Patrick Porter"
> wrote:
>
> »Mabe you can help me. I get the same "Execution error" message with an
> »unwanted End statemtnet to close out my application but if I take it out
and
> »just use an "unload me" the my form seems to re-initialize everytime i
hit
> »my cancel button. and End is the only way i have found to break the
cycle.
> »what is possibly causing it not to unload the form?
>
> Do you have any code in the unload event of the form or an active
> timer that would cause the form to reload?
>
> --
> Paul Marshall
> pmarshal@vulcraft-al.com
0 Likes
Message 11 of 12

Anonymous
Not applicable
On Mon, 12 Mar 2001 07:48:24 -0800, "Patrick Porter"
wrote:

»no code at all just an End
»

Any code after the "Unload Me"?

--
Paul Marshall
pmarshal@vulcraft-al.com
0 Likes
Message 12 of 12

Anonymous
Not applicable
Why do you have an End in the Unload Event? If this event is occurring then
your form is about to be unloaded, you do not need End. I'd try removing it.
This must be a VB (not vbA) project since you have an Unload event?

Regards,
Jacob Dinardi

Patrick Porter wrote in message
news:2FF6481DCE2B9FBBB93CFE24B5C1DB11@in.WebX.maYIadrTaRb...
no code at all just an End

"Paul Marshall" wrote in message
news:fjjhat4lno5cnoj92c3k9bdf62o36cc835@4ax.com...
> On Thu, 8 Mar 2001 08:43:01 -0800, "Patrick Porter"
> wrote:
>
> »Mabe you can help me. I get the same "Execution error" message with an
> »unwanted End statemtnet to close out my application but if I take it out
and
> »just use an "unload me" the my form seems to re-initialize everytime i
hit
> »my cancel button. and End is the only way i have found to break the
cycle.
> »what is possibly causing it not to unload the form?
>
> Do you have any code in the unload event of the form or an active
> timer that would cause the form to reload?
>
> --
> Paul Marshall
> pmarshal@vulcraft-al.com
0 Likes