Results 1 to 9 of 9
  1. #1
    2 Star Lounger
    Join Date
    Feb 2001
    Posts
    141
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Crashin' VB Program (VB6(SP5) & Word 2000(SP1))

    <img src=/S/hello.gif border=0 alt=hello width=25 height=29> Lounge Lizards,

    I'm smackin' into a <img src=/S/brickwall.gif border=0 alt=brickwall width=25 height=15> 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? <img src=/S/hairout.gif border=0 alt=hairout width=31 height=23>

  2. #2
    Silver Lounger
    Join Date
    Mar 2001
    Location
    Springfield, Ohio, USA
    Posts
    2,136
    Thanks
    0
    Thanked 1 Time in 1 Post

    Re: Crashin' VB Program (VB6(SP5) & Word 2000(SP1))

    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
    <font face="Comic Sans MS">Sam Barrett, CACI </font face=comic>
    <small>And the things that you have heard... commit these to faithful men who will be able to teach others also. 2 Timothy 2:2</small>

  3. #3
    2 Star Lounger
    Join Date
    Feb 2001
    Posts
    141
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Crashin' VB Program (VB6(SP5) & Word 2000(SP1))

    <img src=/S/yikes.gif border=0 alt=yikes width=15 height=15> 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.
    Attached Files Attached Files

  4. #4
    4 Star Lounger
    Join Date
    Apr 2001
    Posts
    482
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Crashin' VB Program (VB6(SP5) & Word 2000(SP1))

    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

  5. #5
    2 Star Lounger
    Join Date
    Feb 2001
    Posts
    141
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Crashin' VB Program (VB6(SP5) & Word 2000(SP1))

    That's a good <img src=/S/lightbulb.gif border=0 alt=lightbulb width=15 height=15>. 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. <img src=/S/dizzy.gif border=0 alt=dizzy width=15 height=15>

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

    <img src=/S/cheers.gif border=0 alt=cheers width=30 height=16>

  6. #6
    Star Lounger
    Join Date
    Nov 2001
    Location
    Illinois, USA
    Posts
    60
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Crashin' VB Program (VB6(SP5) & Word 2000(SP1))

    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.

  7. #7
    Star Lounger
    Join Date
    Nov 2001
    Location
    Illinois, USA
    Posts
    60
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Crashin' VB Program (VB6(SP5) & Word 2000(SP1))

    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.

  8. #8
    2 Star Lounger
    Join Date
    Feb 2001
    Posts
    141
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Crashin' VB Program (VB6(SP5) & Word 2000(SP1))

    <img src=/S/thumbup.gif border=0 alt=thumbup width=15 height=15>

    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!

  9. #9
    2 Star Lounger
    Join Date
    Feb 2001
    Posts
    141
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Crashin' VB Program (VB6(SP5) & Word 2000(SP1))

    <img src=/S/bow.gif border=0 alt=bow width=15 height=15> <img src=/S/bravo.gif border=0 alt=bravo width=16 height=30>

    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( <img src=/S/eileen.gif border=0 alt=eileen width=17 height=15>) should promote you to at least a Star Lounger. <img src=/S/grin.gif border=0 alt=grin width=15 height=15>

    Thanks again.

Posting Permissions

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