• Crashin’ VB Program (VB6(SP5) & Word 2000(SP1))

    Home » Forums » AskWoody support » Productivity software by function » Visual Basic for Applications » Crashin’ VB Program (VB6(SP5) & Word 2000(SP1))

    Author
    Topic
    #362630

    hello Lounge Lizards,

    I’m smackin’ into a brickwall on a problem I’m having with a VB6 program that automates Word.

    The program runs fine most of the time, but once in a while I get the error

    “Method ~ of object ~ failed.” or “remote adapter is not compatable”

    I shut down the VB6 program, open Word, close Word, and run the program again, and usually it runs fine. Sometimes Word Dr. Watson’s, but you can fire up Word after Dr. Watson. BTW, this is on a NT4 Workstation.

    If I step through the program in VB6’s IDE, the program runs fine making it very difficult to troubleshoot the problem.

    Has anyone seen those errors when automating Word from VB6? If so, do you know how to fix ’em? hairout

    Viewing 1 reply thread
    Author
    Replies
    • #551185

      It might have to do with whether Word was around before you started. Do you check for that? Maybe even a hidden copy of Word. Before you run, press Ctl-Alt-Del and use the Task Manager to see if WINWORD is around. For any more help, you probably have to post your code so that we can check it out. HTH –Sam

      • #551236

        yikes The code needs some work. More error checking for one thing. This was before I discovered JMail. Although I don’t see anywhere why Word would be detonating. I’ve got references to the scripting runtime and Word 9.0 object library.

        The program compiles a list of Word documents in one folder, a list of PDF files in another folder, and tries to make the PDF files match the Word files. We have a group of users who don’t use Word, but need to read these documents from their Sun boxes. Creating PDF versions of the Word documents was the best solution.

        I’ve had this problem even after rebooting the NT box. The job of the NT box that the program runs on is to just run jobs, and there’s no other jobs that do anything with Word.

        Well, if you have any ideas, let me know. I’m tired of see this job crashed when I come to work in the morning.

        • #551239

          I’m certain no VB expert, but I’m learning. I came across a similar problem on a VBA application I was building.

          For me it ended up being some corruption. I was able to overcome it by exporting all my forms and modules, and then reimporting them into a new document (importing into a new project for VB, I guess).

          Hope that helps!!
          Troy

          • #551244

            That’s a good lightbulb. The funny thing is that I’m not surprised that this could fix the problem. One time, I had an Excel macro blowing up for no reason. I exported the code and imported it into a new workbook and it worked perfectly. dizzy

            I’ll try exportin’ the forms and modules to another VB project and see if it magically cures the problem.

            cheers

    • #551275

      We had this same problem; the VB program would crash only on a few users’ machines at the point in our code where we invoked Word’s Find method. Found this Knowledge Base article that gave a resolution that worked for us. Q292744 Bug: Automation Client Receives Error or Crashes Calling Word’s Find Object. I turned out that a few users had an old Excel object library that has the same Class ID as Word. The KB article explains how to fix this.

      • #551276

        Oops, slight correction to my previous post. I didn’t mean to say that Excel and Word had the same Class ID’s. As the Knowledge Base article explains, it is just a few of the interface identifiers that are duplicated in the old Excel library and Word’s library.

      • #551280

        thumbup

        This looks very interesting and promising.

        I’ll give this a shot.
        Since my weekend starts in less than 10 minutes, I’ll post later on the results.

        THANKS!

      • #551504

        bow bravo

        Per the KB article, I ran the regtlib. It seems to have cured the problem. I’ll keep an eye on it for the next couple of days. If it doesn’t cure the problem, I’ll try the late binding recommendation in the KB article. Late binding won’t be a big problem in this program.

        Someone( eileen) should promote you to at least a Star Lounger. grin

        Thanks again.

    Viewing 1 reply thread
    Reply To: Crashin’ VB Program (VB6(SP5) & Word 2000(SP1))

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

    Your information: