Author Topic: Execution Error ???  (Read 7404 times)

0 Members and 1 Guest are viewing this topic.

ML

  • Guest
Execution Error ???
« on: March 21, 2005, 09:50:47 AM »
With this particular VBA Project and macro, I load it and run the VBA Macro from an ACAD menu macro (see code below).
I unload the project by using UnloadDVB at the end of the VBA Macro

Every thing is working well but at after the VBA Project is unloaded, it says execution error on my AutoCAD command line

Does anyone know why this is and how to get rid of it?

Thank you

Mark


Code: [Select]

^C^C-vbaload;K:/Directory/Directory/Directory/Directory/Legends;^C^C-vbarun;LegendLayers;

Jeff_M

  • King Gator
  • Posts: 4094
  • C3D user & customizer
Execution Error ???
« Reply #1 on: March 21, 2005, 11:19:05 AM »
Mark, This error stems from trying to unload a dvb that is currently running. Remove the "UnloadDVB" from the dvb file and add it to your menu macro:
Code: [Select]

^C^C-vbaload;K:/Directory/Directory/Directory/Directory/Legends;^C^C-vbarun;LegendLayers; vbaunload;K:/Directory/Directory/Directory/Directory/Legends;

Jeff_M

  • King Gator
  • Posts: 4094
  • C3D user & customizer
Execution Error ???
« Reply #2 on: March 21, 2005, 11:23:46 AM »
Better yet, why unload it? Also, you don't need to specifically load it, either. This will work for you.....it will load & run it if it's not loaded and will just run it if it is.
Code: [Select]

^C^C-vbarun;K:/Directory/Directory/Directory/Directory/Legends.dvb!LegendLayers;

ML

  • Guest
Execution Error ???
« Reply #3 on: March 21, 2005, 01:45:30 PM »
Hey Jeff,


The first thing is that I am sharing this macro with the rest of The CAD Dept. so it must be unloaded so that anyone can use it  anytime without a Read-Only error.

The second thing I have noticed in the past is that if I do not have a support path to where the project resides, then vbaunload will not work successfully.

We already have a quite a few support pathes set here, I was trying to avoid having to tell everyone to create another one, this is why I am using UnloadDVB.

This brings me to the next question, how do you get the macro to stop running after it hits the end? We tell it to Exit Sub

Thanks

Mark

ML

  • Guest
Execution Error ???
« Reply #4 on: March 21, 2005, 01:52:16 PM »
This part
Code: [Select]

^C^C-vbarun;K:/Directory/Directory/Directory/Directory/Legends.dvb!LegendLayers;


works real well though. Loads and runs it.

Thank you

Just need to get that execution error off of there still

Jeff_M

  • King Gator
  • Posts: 4094
  • C3D user & customizer
Execution Error ???
« Reply #5 on: March 21, 2005, 03:03:31 PM »
Mark, As long as the UnloadVBA is in the dvb that is calling it, you will get this error. I haven't had a problem with dvb's unloading, providiong you pass the exact same path to it that you use for the loading of it.

ML

  • Guest
Execution Error ???
« Reply #6 on: March 21, 2005, 03:11:24 PM »
Hey Jeff

It is UnloadDVB

So, you have unloaded it without having a support path to it?

Mark

ML

  • Guest
Execution Error ???
« Reply #7 on: March 21, 2005, 03:37:20 PM »
OK,

I used The Send command at the end of the module.
I figured out what i was doing wrong with this method in the past,
I was not using & VbCr at the end, which is the enter. Therefore it would be a problem  :lol:

Thanks again Jeff


'Unload VBA Project
Code: [Select]

 ThisDrawing.SendCommand "vbaunload" & vbCr & "K:\Dir\Dir\Dir\" & _
    "Dir\Legends.dvb" & vbCr

Jeff_M

  • King Gator
  • Posts: 4094
  • C3D user & customizer
Execution Error ???
« Reply #8 on: March 21, 2005, 05:48:34 PM »
?????
Why use the sendcommand? If it works, fine. I just figured it would go at the end of your menu macro, just as I showed before.

Then the end portion of the dvb would be:
  End If
End Sub

Either way, as long as it works for ya! :D

ML

  • Guest
Execution Error ???
« Reply #9 on: March 21, 2005, 06:20:18 PM »
One GREAT reason is becase there are because there are 14 different scales to select from on the pulldown menu.

Each one you select will inserts The Legend Block at that scale. That means, I would have to type out the vbaunload path 14 times instead of once in the module.

Also, I try not to make menu macros really long because they get to be a pain to try to read after a while.

Anyhow, it works great and there is no error.

Thank you again sir!

Mark

ML

  • Guest
Execution Error ???
« Reply #10 on: March 21, 2005, 06:21:00 PM »
One GREAT reason is  there are 14 different scales to select from on the pulldown menu.

Each one you select will inserts The Legend Block at that scale. That means, I would have to type out the vbaunload path 14 times instead of once in the module.

Also, I try not to make menu macros really long because they get to be a pain to try to read after a while.

Anyhow, it works great and there is no error.

Thank you again sir!

Mark