Results 1 to 3 of 3
  1. #1
    2 Star Lounger
    Join Date
    Feb 2010
    Location
    Denver, CO
    Posts
    191
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Automation Error (Excel 2002 (xp) SP2)

    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...

  2. #2
    Platinum Lounger
    Join Date
    Feb 2001
    Location
    Weert, Limburg, Netherlands
    Posts
    4,812
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Automation Error (Excel 2002 (xp) SP2)

    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.
    Jan Karel Pieterse
    Microsoft Excel MVP, WMVP
    www.jkp-ads.com
    Professional Office Developers Association

  3. #3
    2 Star Lounger
    Join Date
    Feb 2010
    Location
    Denver, CO
    Posts
    191
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Automation Error (Excel 2002 (xp) SP2)

    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.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •