VBA loading question...

VBA loading question...

Anonymous
Not applicable
469 Views
6 Replies
Message 1 of 7

VBA loading question...

Anonymous
Not applicable
When I'm working on a VBA project (dvb file) and I'm changing lines of code,
I can typically just execute the macro and the routine (sub/function/etc.)
will run with the new code. Even without having done a save of the dvb
file. Then if I open a new drawing, it's reloaded. I'm working on a
machine running XP and ACAD2000.

However, if I go to a machine running ACAD2002, I have to shutdown ACAD
completely and reopen before it'll load the modified dvb file.

Is there a way to make corrections for this?

I had thought that 2002 would reload the dvb file as it's a load call in one
of my controlling LISP functions (i.e. (vl-vbaload (strcat #JEG_VBA
"JEG.dvb")) ). However, it only seems to happen on Acad2000 systems, not
2002.
0 Likes
470 Views
6 Replies
Replies (6)
Message 2 of 7

Anonymous
Not applicable
I'd have to look into it further for you, but for starters, you are
working in two different versions of vba and lisp which could be causing
you problems. 2000 is vba5 and 2002 is vba6; 2002 sports some
refinements to autolisp in its vl- functions.

___________________________
Mike Tuersley
AutoCAD Clinic
Rand IMAGINiT Technologies
0 Likes
Message 3 of 7

Anonymous
Not applicable
Use

(vl-vbarun "macroname")

Joe
--
0 Likes
Message 4 of 7

Anonymous
Not applicable
Joe,

 

Yeah, I use that when I create my shortcut for the
macro via LISP.  That's not the issue.

 

Particular to my instance:

 

I am writing a form interface that does a sheet
setup.  If I get a debug error, then I go into VBAIDE, I review my code,
make an adjustment.  WITHOUT saving the DVB file whatsoever, I can go back
to AutoCAD, run the macro via my LISP shortcut and it'll run with the adjusted
code.  Again, this is on a system running XP w/ 2000.

 

However, when I take the same action on a system
running W2K w/ 2002.  I can go into VBAIDE to adjust the code for the
error, but when I go back into AutoCAD 2002, it is still running the 'bad'
code.  I even save the DVB first.  I have to completely exit AutoCAD
2002 and restart the application before it will reload the revised code into
residual memory for the AutoCAD session.

 

The difference that I can determine at this point
is that AutoCAD 2000 will reload DVB with every drawing that is opened. 
However, 2002 only reads the DVB file ones and will not reload the code when
each drawing is opened, though it is reloading the same LISP with each drawing
opened that in turn has the load call to the DVB file in it.

 

Hope that makes sense...


style="PADDING-RIGHT: 0px; PADDING-LEFT: 5px; MARGIN-LEFT: 5px; BORDER-LEFT: #000000 2px solid; MARGIN-RIGHT: 0px">
Use
 
(vl-vbarun "macroname")
Joe
--
0 Likes
Message 5 of 7

Anonymous
Not applicable
> I can go into VBAIDE to adjust the code for the error, but when I go back into AutoCAD 2002, it is still running the 'bad' code.



Forgive me if I'm stating the obvious, but are you pressing the 'Reset' button (ie the one with the square on it) in the VBAIDE?



If so, and your program is still running the 'bad' code, I'd suggest putting a Break Point on the line *before* the code you changed and then doing a Step Trace to see what is actually being executed.



Regards



Wayne Ivory

IT Analyst Programmer

Wespine Industries Pty Ltd
0 Likes
Message 6 of 7

Anonymous
Not applicable
Jason,

I use the exact approach that you are describing and have done so in 2000, i, 2002 and 2004 and have never had any problems. I noticed that Wayne made a comment and I would to perhaps expand upon that. When you say "fixed" your code are you referring to being in break mode, fix-it, then continue? Or are you stopping execution completely, fix-it, then re-execute?

If none of the above is the case then my first suggestion would be to re-install 2002.

Joe
--
0 Likes
Message 7 of 7

Anonymous
Not applicable
I'll take another look and see if I'm missing the
reset button that Wayne has mentioned. However, my basic note is that I
don't have to do any sort of reset with 2000, it seems to 'reread' the DVB code
at each execution, whether I save the file, or to any reload.  At this
point, 2002 doesn't seem to do that.

 

 Yes, I completely stop execution, change the
code, then re-execute.  I
t's not that it's
a big deal, the user can deal with having to reopen AutoCAD, just wondered if
perhaps there were something I'm missing.

 


style="PADDING-RIGHT: 0px; PADDING-LEFT: 5px; MARGIN-LEFT: 5px; BORDER-LEFT: #000000 2px solid; MARGIN-RIGHT: 0px">
Jason,

I use the exact approach that you are describing and have done so in 2000,
i, 2002 and 2004 and have never had any problems. I noticed that Wayne made a
comment and I would to perhaps expand upon that. When you say "fixed" your
code are you referring to being in break mode, fix-it, then continue? Or are
you stopping execution completely, fix-it, then re-execute?

If none of the above is the case then my first suggestion would be to
re-install 2002.

Joe
--

0 Likes