none
Word 2012 failing on documents.add OLE call RRS feed

  • Question

  • We were populating a Word Doc using OLE.

    Word 2012 was working but now is failing on documents.add OLE call from a Powerbuilder app. Then over the weekend it started failing on

       OLEobject.documents.add (template name)

    We have updated the Powerbuilder app on the weekend but there were no OLE changes. No objects calling OLE to WORD have changed. This same app works fine on a Windows 7 machine using WORD 2010 so the code is correct.

    The documents exist in the path specified and older WORD clients get the template populated with no problem. I suspected corruption so I swapped out the PB app for a fresh one and I swapped out all the templates for a fresh copy. Still we have a problem.

    any idea?

    Thanks,

    Doug

    Thursday, December 13, 2012 4:00 PM

All replies

  • Hi Doug

    There is no Word for Windows version 2012. There's 2010 and 2013. Which are you using? I assume 2013 since you mention 2010 in the text?

    Please describe exactly HOW your application is "failing". Are you getting an error message? What is it?


    Cindy Meister, VSTO/Word MVP, my blog

    Thursday, December 13, 2012 4:50 PM
    Moderator
  • Sorry, the problem is on a field machine and is occuring WORD 2010  version 14.0.6123.5005.  Here in the main office, we tested Word 2010 (version 14.0.6023.1000) on a Windows machine and it works fine. The field user says all was fine until an automatic upload to the newest version of the powerbuilder app.

    That doesn't make too much sense since no code connected to the OLE calls were changed. So I'm sort of grasping at staws. I am making small test app for the user to run to see if I can capture the problem better. I was hoping someone knew of an OLE problem in WORD 2010 that could explain this.

    The error that come out of the application shows that PB connected to a new WORD and it successfully found the template that we want to add. Then it fails on the add.

          ole_1.Documents.Add(ls_template)

    If it happened on only one machine, we might think it was purely environmental but the user has confirmed that it happens on at least 2 machines.

    Do you know how I can find the OLE error instead of just the PB message of where the error occurred?

    Sorry for fat-fingerring the WORD Version.

    Thank you for your efforts.

    Friday, December 14, 2012 12:48 PM
  • Hi Doug

    You still haven't described HOW the application is failing and what the error message is. It may be obvious to you, but I, for one, have never used PowerBuilder and have no idea how a "fail" manifests itself. Without that information we can't even begin to guess what the problem might be...

    What makes you keep using the term "OLE error", for example?


    Cindy Meister, VSTO/Word MVP, my blog

    Friday, December 14, 2012 2:52 PM
    Moderator
  • Hi Cindy,

    Thanks for trying again. I haven't been able to recreate this problem so I have no exact error message. It is happening in the field and the error message they see only points to the line of Powerbuilder code when the error occurs. The line of code is after the app connects to a MS WORD application through OLE (object linking and Embedding)

            <It uses

                Ole_1.ConnectToObject("","Word.Application")

                         if WORD is already running

           and

                ole_1.ConnectToNewObject("Word.Application")

                    if MS WORD is not yet running.>

    Then the code tries to open a template in WORD as told earlier:

          ole_1.Documents.Add(ls_template)

    This is where the error message pops up and tell us the ADD line above is the culprit.

    I have asked the user for an image of this error message box and I have created a small app for her to use to give step by step and clearer messages but I don't have any more information yet.

    Thank you I'll post more when she responds.

    Friday, December 14, 2012 3:10 PM
  • Hi Doug

    << I'll post more when she responds>>

    OK... FWIW there are no other posts about what I'd call "unusual problems", here. There was one that made me suspicious the other day that was Excel-related and had to do with opening old file formats in Excel 2007. That error mentioned OLE and sounded to me like something anti-virus software-related that we used to see a few years ago. Other than that, nothing.

    OTOH, the forums are experiencing major problems today: the message lists aren't updating for the last 10 or twelve hours. So it's possible that others may be trying to report problems.

    There were some major Updates coming down the pipeline the last couple of days. I don't know any details, just that "things were happening" while I was working with Windows. So it's conceivable that there's a connection, but really no data, as yet.


    Cindy Meister, VSTO/Word MVP, my blog

    Friday, December 14, 2012 3:23 PM
    Moderator