VBA and network

Discussion in 'AutoCAD' started by KingCAD, Jul 7, 2003.

  1. KingCAD

    KingCAD Guest

    WE have a program (one that I'm sure of) written in VBA for AutoCAD 2002 that was working fine for a long time and now it doesn't. The program seems to exit prematurely, as though you had cancelled it, and not always in the same spot! When I run it in "debug"(step through it) it works perfect. When I let it run as designed it has this problem. When I load and run it on a computer that is NOT plugged into our network it runs perfect. Based on this (and a few other tests) I have to blame something in our network, But when I brought it to out IT guy he says nothing has changed in our network and that can’t be the problem.
    So - if it's not the network, and it's not my program - what the heck could it be?
    Anybody have an idea where I could look, or where I could suggest that our IT guy look???
    I'd be happy to send the files to anyone who thinks they can help.
    Thanks guys.
    Dave. K
     
    KingCAD, Jul 7, 2003
    #1
  2. Prior to TuFer (A2k4) there was a limit to the number of concurrent
    connections to a .dvb file of around 15-20 users. Are you copying the dvbs
    to the local ws, and running them from there?


    --
    R. Robert Bell, MCSE
    www.AcadX.com


    | WE have a program (one that I'm sure of) written in VBA for AutoCAD 2002
    that was working fine for a long time and now it doesn't. The program seems
    to exit prematurely, as though you had cancelled it, and not always in the
    same spot! When I run it in "debug"(step through it) it works perfect. When
    I let it run as designed it has this problem. When I load and run it on a
    computer that is NOT plugged into our network it runs perfect. Based on this
    (and a few other tests) I have to blame something in our network, But when I
    brought it to out IT guy he says nothing has changed in our network and that
    can’t be the problem.
    | So - if it's not the network, and it's not my program - what the heck
    could it be?
    | Anybody have an idea where I could look, or where I could suggest that our
    IT guy look???
    | I'd be happy to send the files to anyone who thinks they can help.
    | Thanks guys.
    | Dave. K
     
    R. Robert Bell, Jul 7, 2003
    #2
  3. KingCAD

    KingCAD Guest

    I'm not really sure what that means but. Te program itself is "Usually" located on a network drive and accessed through a menu pick. However I have tried placing it on the local drive so that no one else has access to it, and I still get the same result. It only works when I am NOT hooked up to the network. Even though the program is on the local drive and does not go to the network for information. And it has been working when on the networtk drive for a long time. I am unsure when it stopped but I was justtold about a week ago, and the program was written 1-09-01.

    Thanks!
    Dave. K
     
    KingCAD, Jul 7, 2003
    #3
  4. KingCAD

    Jason Wilder Guest

    Has anything else changed, are you using a newer version of AutoCAD?



    "KingCAD" <> wrote in message news:...

    WE have a program (one that I'm sure of) written in VBA for AutoCAD 2002 that was working fine for a long time and now it doesn't. The program seems to exit prematurely, as though you had cancelled it, and not always in the same spot! When I run it in "debug"(step through it) it works perfect. When I let it run as designed it has this problem. When I load and run it on a computer that is NOT plugged into our network it runs perfect. Based on this (and a few other tests) I have to blame something in our network, But when I brought it to out IT guy he says nothing has changed in our network and that can’t be the problem.
    So - if it's not the network, and it's not my program - what the heck could it be?
    Anybody have an idea where I could look, or where I could suggest that our IT guy look???
    I'd be happy to send the files to anyone who thinks they can help.
    Thanks guys.
    Dave. K
     
    Jason Wilder, Jul 7, 2003
    #4
  5. We have had similar problems. The biggest culprit was our company's standard of Microsoft Office 97. DO NOT INSTALL THIS AFTER AUTOCAD 200x!



     



    "Jason Wilder" <> wrote in message news:...



    Has anything else changed, are you using a newer version of AutoCAD?



    "KingCAD" <> wrote in message news:...

    WE have a program (one that I'm sure of) written in VBA for AutoCAD 2002 that was working fine for a long time and now it doesn't. The program seems to exit prematurely, as though you had cancelled it, and not always in the same spot! When I run it in "debug"(step through it) it works perfect. When I let it run as designed it has this problem. When I load and run it on a computer that is NOT plugged into our network it runs perfect. Based on this (and a few other tests) I have to blame something in our network, But when I brought it to out IT guy he says nothing has changed in our network and that can’t be the problem.
    So - if it's not the network, and it's not my program - what the heck could it be?
    Anybody have an idea where I could look, or where I could suggest that our IT guy look???
    I'd be happy to send the files to anyone who thinks they can help.
    Thanks guys.
    Dave. K
     
    Douglas Christensen, Jul 7, 2003
    #5
  6. KingCAD

    Jason Wilder Guest

    Well, I'm not all that savvy on the VBA controlling files, but I would imagine it is possible that if something put older or different shared resource files on your system, that could screw up some of the VBA functions?



     



    Someone needs to chime in on this... :S



    "Douglas Christensen" <> wrote in message news:...



    We have had similar problems. The biggest culprit was our company's standard of Microsoft Office 97. DO NOT INSTALL THIS AFTER AUTOCAD 200x!



     



    "Jason Wilder" <> wrote in message news:...



    Has anything else changed, are you using a newer version of AutoCAD?



    "KingCAD" <> wrote in message news:...

    WE have a program (one that I'm sure of) written in VBA for AutoCAD 2002 that was working fine for a long time and now it doesn't. The program seems to exit prematurely, as though you had cancelled it, and not always in the same spot! When I run it in "debug"(step through it) it works perfect. When I let it run as designed it has this problem. When I load and run it on a computer that is NOT plugged into our network it runs perfect. Based on this (and a few other tests) I have to blame something in our network, But when I brought it to out IT guy he says nothing has changed in our network and that can’t be the problem.
    So - if it's not the network, and it's not my program - what the heck could it be?
    Anybody have an idea where I could look, or where I could suggest that our IT guy look???
    I'd be happy to send the files to anyone who thinks they can help.
    Thanks guys.
    Dave. K
     
    Jason Wilder, Jul 8, 2003
    #6
  7. KingCAD

    KingCAD Guest

    The program was written in Jan 2001, I'm not sure when we switched to AutoCAD 2002 but it was right after it became available and the program has been working fine up until a week or two ago.
    We currently use both Office 2000 and 97, the machines that have 97 had it all along and the program worked fine. It now doesn't work on any of the machines.(if they are logged onto our network)
    This is the part I cannot understand - The program works fine as long when I install it on the local drive and unplug from the network. BUT plug the same machine into the network and run the same program from the local drive and it fails. I have resaved, renamed, altered, folded and mutilated to no avail.
    If it is indeed some older or different shared resource file, How would I find out which one??
    I really don't want to rewrite this in LISP if I can avoid it, but I have about 20 users screaming because they can't use it and have to actually draw for themselves.

    What I need is a cure for the common code.
    Thanks!
    Dave. K
     
    KingCAD, Jul 8, 2003
    #7
  8. KingCAD

    wivory Guest

    Nasty one Dave. The fact that it works in step-trace mode but not in production makes it trickier. This fact though and the one that it works locally but not on the network suggests to me there may be a performance-related issue. Does the program use any SendCommand/SendKeys statements? If so it may be that the timing of these is getting mucked up when running over the network.
      
    Failing that, my suggestion would be to splatter the code either with MsgBox statements, or if the program is too big for that to write similar stuff to a log file.


    Open "Debug.txt" For Output As 1 Print #1, "About to initialise" .. .. .. Print #1, "About to draw lines" .. .. .. Print #1, "About to calculate dimensions" .. .. .. Close #1

    When the program crashes check in the log file where it got up to. Eventually you should be able to narrow it down to what statement is causing the program to fail. Good luck!
      
    Regards
      
    Wayne Ivory
    IT Analyst Programmer
    Wespine Industries Pty Ltd
     
    wivory, Jul 9, 2003
    #8
  9. KingCAD

    perdaso Guest

    Hi,

    This seems to be a doevents problem. You're computer is still busy processing one thing while your code continues executing. Bypassing this problem is easy by placing some DoEvents. I usually program a loop with 100 or 1000 doevents;

    For a=0 to 100
       DoEvents
    Next

    good luck!
     
    perdaso, Jul 9, 2003
    #9
  10. KingCAD

    Jason Wilder Guest

    I'm at a loss, it obviously doesn't rely on any special reference files, doesn't seem like it's all that network dependent.  The only dependancy would seem to be with the PC3 files, but I ran it as though I was plotting and it'd still draw it, just no plot.



     



    All the coding looks good.  Of course, I'm running it on 2000, I'll try it on 2002 a little later and see if it runs differently.



    "KingCAD" <> wrote in message news:...

    Okay let's see if I can post the code. my attempt is to post a ".zip" file containing all the related files, so that you can unzip them to the folder C;Temp/GDoor and then load into AutoCAD and run. If any body can see the problem or a fix give me a hollar, Please and thank you.
    Dave. K
     
    Jason Wilder, Jul 9, 2003
    #10
  11. KingCAD

    wivory Guest

    I realised I made that previous example overly complex, because of course instead of writing to a log file you can just use Debug.Print instead and see the results in the Immediate Window (turn this on under the View menu if you can't see it). I really think you should try this approach before you go rewriting the whole thing in LISP. You said in your original post it doesn't always stop at the same spot. But it might be perhaps that it always stops at the same *type* of statement, eg a database access (I haven't looked at your sample so I don't actually know what it is doing).
      
    Regards
      
    Wayne
     
    wivory, Jul 10, 2003
    #11
Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.