• Automation Error (Excel 2002 (xp) SP2)

    Author
    Topic
    #410202

    I have two frustrating behaviors happening and I can’t get a handle on why.

    I am using Access 2002 to automate Excel. In the process of running my code, I get the following error: “The remote server machine does not exist or is not available”. I get this what seems intermittently. I am working with a spreadsheet that is located on a server–I assume this is the “remote machine”? If this means that I am losing my connection with the server, I see no other evidence of this. I can still get to the folder through Explorer.

    Secondly, while trying to debug this code, I am stepping through it line by line, but there seems to be some lines that cause the code to just take off and ignore the line by line routine. This has happened on other projects, also. One of the lines is right after a CopyFromRecordset Method. Line by line works flawlessly up to that point, then it’s just like a pushed F5. Has anyone else had such behaviors? What causes that?

    Thanks for everyone’s help…

    Viewing 1 reply thread
    Author
    Replies
    • #879871

      It might help to show us some of your code.

      I have no idea what causes the “server problem” message, maybe you have Excel do something that takes too much time in Access’ opinion?

      As to your second point: Sometimes when a line of code causes an error, VBA simply quits the sub or function it resides in and takes you to the calling statement of that sub or function. It gives you the impression it runs through getting out of step mode. Have you tried putting a breakpoint on the next line?
      I have seen this e.g. when the calling sub has an error handler but the sub or function itself does not.

      • #880553

        Jan–

        Thanks for the response. I was aware that an error cut the procedure short, but I thought that if there was an error handler in that procedure, it handled the error instead of sending it back tot he call procedure. I don’t think this is what happened, however. I tried what you recommended–that is, put a breakpoint after the point where the procedure just took off. The breakpoint stopped the procedure from running and I could continue processing line by line. (I then figured out that it was erroring as some later point, which has not been corrected.) However, I am still stumped by the fact that it just takes off at this one point. I had another project do the same thing, but I never follow up on it.

        As a test, I moved the breakpoint you recommended down in the procedure by a few lines and found that once the code takes off, the other lines do process, just not line by line. I know how to get around this now, but I’m just wondering if anyone knew why it was happening like that.

      • #880554

        Jan–

        Thanks for the response. I was aware that an error cut the procedure short, but I thought that if there was an error handler in that procedure, it handled the error instead of sending it back tot he call procedure. I don’t think this is what happened, however. I tried what you recommended–that is, put a breakpoint after the point where the procedure just took off. The breakpoint stopped the procedure from running and I could continue processing line by line. (I then figured out that it was erroring as some later point, which has not been corrected.) However, I am still stumped by the fact that it just takes off at this one point. I had another project do the same thing, but I never follow up on it.

        As a test, I moved the breakpoint you recommended down in the procedure by a few lines and found that once the code takes off, the other lines do process, just not line by line. I know how to get around this now, but I’m just wondering if anyone knew why it was happening like that.

    • #879872

      It might help to show us some of your code.

      I have no idea what causes the “server problem” message, maybe you have Excel do something that takes too much time in Access’ opinion?

      As to your second point: Sometimes when a line of code causes an error, VBA simply quits the sub or function it resides in and takes you to the calling statement of that sub or function. It gives you the impression it runs through getting out of step mode. Have you tried putting a breakpoint on the next line?
      I have seen this e.g. when the calling sub has an error handler but the sub or function itself does not.

    Viewing 1 reply thread
    Reply To: Automation Error (Excel 2002 (xp) SP2)

    You can use BBCodes to format your content.
    Your account can't use all available BBCodes, they will be stripped before saving.

    Your information: