Strange Automation Issue

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Neil Ginsberg

    #16
    Re: Strange Automation Issue

    Here's an update on the situation.

    You'll recall that there are two machines with problems, and two apps --
    "App A" (the original) and "App B" (the pared-down version). One machine had
    problems with automation with App A; the other machine worked with App A but
    had automation issues with App B. No other machines had problems. At least
    part of the puzzle has been resolved.

    The user who was having trouble with App A had created a shortcut to Word on
    her own, and, it turns out, she found an old copy of Word 97 on the server
    and opened that instead of Word 2000. After that, the automation code in
    Access didn't work (the reference was to Word 2000) -- though, for some
    reason, it was able to open Word and create the reference, but wasn't able
    to do anything with it. Once she stopped using that shortcut and began using
    Word 2000 again, the problem went away.

    So that takes care of that.

    Regarding the second issue, as noted in my response to TC, it turns out that
    I *did* have different code between App A and App B -- App A had been
    changed a few months back, though I forgot about it. App A was using early
    binding, and App B was using late binding. And, despite the literature,
    early binding was working, but late binding wasn't. So I changed App B to
    early binding to match App A, but it's still not working.

    And that's where I'm at now.

    Neil
    All the news that's fit to print.


    "Geoff" <geoff@nospam.f or.me.com> wrote in message
    news:bnquv8$vhs $1@newsg2.svr.p ol.co.uk...[color=blue]
    > Neil
    >
    > Now that this thread has arrived on my machine and
    > notwithstanding Tom's lead in the other thread (which
    > perhaps offers more hope).
    >
    > Word is (I believe) an application that likes to have only
    > one instance running - although I think I've got multiple
    > instances running from code before now for reasons
    > I've never got to the bottom of. Also, I've read some
    > incomprehensibl e stuff on memory not being released
    > when some object variables are set to Nothing after
    > they've been created using 'New' (even when no other
    > variables are pointing to the same object).
    >
    > So, as you're using CreateObject, is there any mileage
    > in using the GetObject function first (to utilise any
    > running instance of Word, if Word prefers to be in
    > memory only once or simply to save system resources).
    > And, if GetObject produces error 429, then using
    > CreateObject?
    >
    > I've seen two coding variations for the above, each of
    > which uses a boolean variable to leave Word running
    > if GetObject was successful, but quit Word if
    > CreateObject was successful. (I can post samples if
    > you want them.)
    >
    > No doubt you're destroying object variables when
    > no longer needed by setting them to Nothing.
    >
    > Presumably all Office/Windows service packs are
    > installed on the offending machine.
    >
    > I realise this doesn't address your specific issue or
    > the bizarre nature of your code suddenly not
    > working - but HTH.
    >
    > Like Tom, I'd be interested in your solution.
    >
    > Regards
    > Geoff
    >
    >[/color]


    Comment

    • Neil Ginsberg

      #17
      Re: Strange Automation Issue

      Here's a new twist. I just went into App B with the new early binding code
      on the machine that's having problems (no other machine has problems), and
      ran the code to open a Word doc. Interesting results. I get a message that
      the specific document is locked by another user (the current user of that
      machine) and I'm given the option of opening it Read Only, etc. I select
      Read Only and the document opens in Word. I then go back to my app, and
      there's the same Automation Error as before -- only, instead of it being on
      the line that opens the Word doc, it's on the line:

      objWord.visible = True

      The Word instance was already visible, since I saw the document open. But
      that line of code hadn't been executed.

      Again, this is the same code that's running fine on other machines.
      Interesting.

      Neil

      "Neil Ginsberg" <nrg@nrgconsult .com> wrote in message
      news:hTzob.1016 7$Px2.7595@news read4.news.pas. earthlink.net.. .[color=blue]
      > Here's an update on the situation.
      >
      > You'll recall that there are two machines with problems, and two apps --
      > "App A" (the original) and "App B" (the pared-down version). One machine[/color]
      had[color=blue]
      > problems with automation with App A; the other machine worked with App A[/color]
      but[color=blue]
      > had automation issues with App B. No other machines had problems. At least
      > part of the puzzle has been resolved.
      >
      > The user who was having trouble with App A had created a shortcut to Word[/color]
      on[color=blue]
      > her own, and, it turns out, she found an old copy of Word 97 on the server
      > and opened that instead of Word 2000. After that, the automation code in
      > Access didn't work (the reference was to Word 2000) -- though, for some
      > reason, it was able to open Word and create the reference, but wasn't able
      > to do anything with it. Once she stopped using that shortcut and began[/color]
      using[color=blue]
      > Word 2000 again, the problem went away.
      >
      > So that takes care of that.
      >
      > Regarding the second issue, as noted in my response to TC, it turns out[/color]
      that[color=blue]
      > I *did* have different code between App A and App B -- App A had been
      > changed a few months back, though I forgot about it. App A was using early
      > binding, and App B was using late binding. And, despite the literature,
      > early binding was working, but late binding wasn't. So I changed App B to
      > early binding to match App A, but it's still not working.
      >
      > And that's where I'm at now.
      >
      > Neil
      > All the news that's fit to print.
      >
      >
      > "Geoff" <geoff@nospam.f or.me.com> wrote in message
      > news:bnquv8$vhs $1@newsg2.svr.p ol.co.uk...[color=green]
      > > Neil
      > >
      > > Now that this thread has arrived on my machine and
      > > notwithstanding Tom's lead in the other thread (which
      > > perhaps offers more hope).
      > >
      > > Word is (I believe) an application that likes to have only
      > > one instance running - although I think I've got multiple
      > > instances running from code before now for reasons
      > > I've never got to the bottom of. Also, I've read some
      > > incomprehensibl e stuff on memory not being released
      > > when some object variables are set to Nothing after
      > > they've been created using 'New' (even when no other
      > > variables are pointing to the same object).
      > >
      > > So, as you're using CreateObject, is there any mileage
      > > in using the GetObject function first (to utilise any
      > > running instance of Word, if Word prefers to be in
      > > memory only once or simply to save system resources).
      > > And, if GetObject produces error 429, then using
      > > CreateObject?
      > >
      > > I've seen two coding variations for the above, each of
      > > which uses a boolean variable to leave Word running
      > > if GetObject was successful, but quit Word if
      > > CreateObject was successful. (I can post samples if
      > > you want them.)
      > >
      > > No doubt you're destroying object variables when
      > > no longer needed by setting them to Nothing.
      > >
      > > Presumably all Office/Windows service packs are
      > > installed on the offending machine.
      > >
      > > I realise this doesn't address your specific issue or
      > > the bizarre nature of your code suddenly not
      > > working - but HTH.
      > >
      > > Like Tom, I'd be interested in your solution.
      > >
      > > Regards
      > > Geoff
      > >
      > >[/color]
      >
      >[/color]


      Comment

      • Tom Wickerath

        #18
        Re: Strange Automation Issue

        Did you work as an "indexer" as your first job? <smile>

        Also, have you been able to rule out the possibility of incorrect OLE Automation
        system files? I was thinking that perhaps this particular PC does not have the
        Windows XP operating system, but it had some other software installed, which may
        have installed an incorrect version of the OLE Automation files intended for
        Windows XP. That scenerio may have led to the automation error you reported for
        your application....

        _______________ _______________ _______

        "Neil Ginsberg" <nrg@nrgconsult .com> wrote in message
        news:D3oob.9507 $RQ1.6299@newsr ead3.news.pas.e arthlink.net...
        [color=blue]
        > and I would have thought that Access 2002 is a part of Office XP, and that
        > Access 2003 is a part of Office 2003.[/color]

        Remember: indexers are just poor slobs who have stared at too many
        characters over too many cups of coffee for too many hours.

        Neil



        Comment

        • TC

          #19
          Re: Strange Automation Issue

          Keep us posted!

          TC


          "Neil Ginsberg" <nrg@nrgconsult .com> wrote in message
          news:s0Aob.1018 1$Px2.8796@news read4.news.pas. earthlink.net.. .[color=blue]
          > Here's a new twist. I just went into App B with the new early binding code
          > on the machine that's having problems (no other machine has problems), and
          > ran the code to open a Word doc. Interesting results. I get a message that
          > the specific document is locked by another user (the current user of that
          > machine) and I'm given the option of opening it Read Only, etc. I select
          > Read Only and the document opens in Word. I then go back to my app, and
          > there's the same Automation Error as before -- only, instead of it being[/color]
          on[color=blue]
          > the line that opens the Word doc, it's on the line:
          >
          > objWord.visible = True
          >
          > The Word instance was already visible, since I saw the document open. But
          > that line of code hadn't been executed.
          >
          > Again, this is the same code that's running fine on other machines.
          > Interesting.
          >
          > Neil
          >
          > "Neil Ginsberg" <nrg@nrgconsult .com> wrote in message
          > news:hTzob.1016 7$Px2.7595@news read4.news.pas. earthlink.net.. .[color=green]
          > > Here's an update on the situation.
          > >
          > > You'll recall that there are two machines with problems, and two apps --
          > > "App A" (the original) and "App B" (the pared-down version). One machine[/color]
          > had[color=green]
          > > problems with automation with App A; the other machine worked with App A[/color]
          > but[color=green]
          > > had automation issues with App B. No other machines had problems. At[/color][/color]
          least[color=blue][color=green]
          > > part of the puzzle has been resolved.
          > >
          > > The user who was having trouble with App A had created a shortcut to[/color][/color]
          Word[color=blue]
          > on[color=green]
          > > her own, and, it turns out, she found an old copy of Word 97 on the[/color][/color]
          server[color=blue][color=green]
          > > and opened that instead of Word 2000. After that, the automation code in
          > > Access didn't work (the reference was to Word 2000) -- though, for some
          > > reason, it was able to open Word and create the reference, but wasn't[/color][/color]
          able[color=blue][color=green]
          > > to do anything with it. Once she stopped using that shortcut and began[/color]
          > using[color=green]
          > > Word 2000 again, the problem went away.
          > >
          > > So that takes care of that.
          > >
          > > Regarding the second issue, as noted in my response to TC, it turns out[/color]
          > that[color=green]
          > > I *did* have different code between App A and App B -- App A had been
          > > changed a few months back, though I forgot about it. App A was using[/color][/color]
          early[color=blue][color=green]
          > > binding, and App B was using late binding. And, despite the literature,
          > > early binding was working, but late binding wasn't. So I changed App B[/color][/color]
          to[color=blue][color=green]
          > > early binding to match App A, but it's still not working.
          > >
          > > And that's where I'm at now.
          > >
          > > Neil
          > > All the news that's fit to print.
          > >
          > >
          > > "Geoff" <geoff@nospam.f or.me.com> wrote in message
          > > news:bnquv8$vhs $1@newsg2.svr.p ol.co.uk...[color=darkred]
          > > > Neil
          > > >
          > > > Now that this thread has arrived on my machine and
          > > > notwithstanding Tom's lead in the other thread (which
          > > > perhaps offers more hope).
          > > >
          > > > Word is (I believe) an application that likes to have only
          > > > one instance running - although I think I've got multiple
          > > > instances running from code before now for reasons
          > > > I've never got to the bottom of. Also, I've read some
          > > > incomprehensibl e stuff on memory not being released
          > > > when some object variables are set to Nothing after
          > > > they've been created using 'New' (even when no other
          > > > variables are pointing to the same object).
          > > >
          > > > So, as you're using CreateObject, is there any mileage
          > > > in using the GetObject function first (to utilise any
          > > > running instance of Word, if Word prefers to be in
          > > > memory only once or simply to save system resources).
          > > > And, if GetObject produces error 429, then using
          > > > CreateObject?
          > > >
          > > > I've seen two coding variations for the above, each of
          > > > which uses a boolean variable to leave Word running
          > > > if GetObject was successful, but quit Word if
          > > > CreateObject was successful. (I can post samples if
          > > > you want them.)
          > > >
          > > > No doubt you're destroying object variables when
          > > > no longer needed by setting them to Nothing.
          > > >
          > > > Presumably all Office/Windows service packs are
          > > > installed on the offending machine.
          > > >
          > > > I realise this doesn't address your specific issue or
          > > > the bizarre nature of your code suddenly not
          > > > working - but HTH.
          > > >
          > > > Like Tom, I'd be interested in your solution.
          > > >
          > > > Regards
          > > > Geoff
          > > >
          > > >[/color]
          > >
          > >[/color]
          >
          >[/color]


          Comment

          • Geoff

            #20
            Re: Strange Automation Issue

            Thanks for the kick up the proverbial...

            You've forced me to re-read about single-use and
            multiple-use application classes.

            I see that Word's application class is single-use (by
            default) or multiple-use. This was the missing piece
            of the jigsaw in my understanding of using 'New',
            'CreateObject' and 'GetObject'.

            This seems amazing now as I've been using these
            commands successfully for some time.

            Thanks again.
            Geoff







            Comment

            • Geoff

              #21
              Re: Strange Automation Issue

              > Again, this is the same code that's running[color=blue]
              > fine on other machines.[/color]

              Neil,

              Starting from the above premise, if the code runs fine
              on other machines, then it seems the problem is not
              with the code, but with the user or the machine.

              User: Does the user only have read-only rights to
              the folder in which the Word document is stored?

              (Presumably the file is not read-only if other users
              are OK.)

              Machine:
              * Is the network connection OK?
              * Is the software on this machine up-to-date?
              * Is the right software being used?

              (Don't you just love users who set up shortcuts?
              Who'd have thought of that one?)

              Waiting with bated breath for your patience to
              snap so we get to see the unprintable comments!

              Regards
              Geoff

              PS I don't get the early/late-binding issue if
              references were set correctly.



              Comment

              • Neil Ginsberg

                #22
                Re: Strange Automation Issue

                I agree that it seems to be the machine. The app appears to have no problems
                on any other machine, and, now that the other issue (where the user was
                opening an old version of Word) is resolved, I'm chalking this last issue up
                to the machine, and stepping away from it for a while. The machine that's
                having problems is only used as a dial-up portal for us PCAnywhere users, so
                it's not a biggie. So, for now, I'm letting it drop. If I ever get this
                resolved, I'll be sure to post it here.

                Thanks everyone for your help!

                (Sorry about not having any unprintable comments to print! :-) )

                Neil


                "Geoff" <geoff@nospam.f or.me.com> wrote in message
                news:bo3fc6$og4 $2@news8.svr.po l.co.uk...[color=blue][color=green]
                > > Again, this is the same code that's running
                > > fine on other machines.[/color]
                >
                > Neil,
                >
                > Starting from the above premise, if the code runs fine
                > on other machines, then it seems the problem is not
                > with the code, but with the user or the machine.
                >
                > User: Does the user only have read-only rights to
                > the folder in which the Word document is stored?
                >
                > (Presumably the file is not read-only if other users
                > are OK.)
                >
                > Machine:
                > * Is the network connection OK?
                > * Is the software on this machine up-to-date?
                > * Is the right software being used?
                >
                > (Don't you just love users who set up shortcuts?
                > Who'd have thought of that one?)
                >
                > Waiting with bated breath for your patience to
                > snap so we get to see the unprintable comments!
                >
                > Regards
                > Geoff
                >
                > PS I don't get the early/late-binding issue if
                > references were set correctly.
                >
                >
                >[/color]


                Comment

                • Neil Ginsberg

                  #23
                  Re: Strange Automation Issue


                  "Tom Wickerath" <AOS168 AT Comcast DOT com> wrote in message
                  news:HnnAIx.EK6 @news.boeing.co m...[color=blue]
                  > Did you work as an "indexer" as your first job? <smile>[/color]

                  Actually, I was a tech writer for a few years and had to do my own indexes.
                  As much as I'd want the indexes to be perfect, there were always flaws in
                  them, and it was always a tedious job that I couldn't wait to be finished
                  with. So I have sympathy for indexers and have come to not expect much from
                  indexes (or, at least, I'm willing to see the human element in the index).
                  [color=blue]
                  > Also, have you been able to rule out the possibility of incorrect OLE[/color]
                  Automation[color=blue]
                  > system files? I was thinking that perhaps this particular PC does not[/color]
                  have the[color=blue]
                  > Windows XP operating system, but it had some other software installed,[/color]
                  which may[color=blue]
                  > have installed an incorrect version of the OLE Automation files intended[/color]
                  for[color=blue]
                  > Windows XP. That scenerio may have led to the automation error you[/color]
                  reported for[color=blue]
                  > your application....[/color]

                  That could be. It seems clearly to be something with the machine, and that
                  seems a likely explanation.

                  Neil

                  [color=blue]
                  >
                  > _______________ _______________ _______
                  >
                  > "Neil Ginsberg" <nrg@nrgconsult .com> wrote in message
                  > news:D3oob.9507 $RQ1.6299@newsr ead3.news.pas.e arthlink.net...
                  >[color=green]
                  > > and I would have thought that Access 2002 is a part of Office XP, and[/color][/color]
                  that[color=blue][color=green]
                  > > Access 2003 is a part of Office 2003.[/color]
                  >
                  > Remember: indexers are just poor slobs who have stared at too many
                  > characters over too many cups of coffee for too many hours.
                  >
                  > Neil
                  >
                  >
                  >[/color]


                  Comment

                  • Neil Ginsberg

                    #24
                    Re: Strange Automation Issue

                    I should add that there are "profession al indexers" who do nothing but that.
                    So, apparently, they're not all poor overworked slobs. Some actually thrive
                    in that field. I just recall how I felt when I did my indexes........ .

                    :-)

                    Neil

                    "Tom Wickerath" <AOS168 AT Comcast DOT com> wrote in message
                    news:HnnAIx.EK6 @news.boeing.co m...[color=blue]
                    > Did you work as an "indexer" as your first job? <smile>
                    >[/color]


                    Comment

                    • Tom Wickerath

                      #25
                      Re: Strange Automation Issue

                      I know you indicated in another post (11/3/03, 11:25 PM) that:

                      "So, for now, I'm letting it drop. If I ever get this
                      resolved, I'll be sure to post it here".

                      But, I'm still curious if the OLE Automation system files might be the issue. Can you
                      search for the file named "Oleaut32.d ll" on the PC that is still having the problem, and
                      report back which version that it is? Also, which operating system does this machine
                      have?

                      Ref.: http://support.microsoft.com/default...b;en-us;320108

                      _______________ _______________ _______________

                      "Neil Ginsberg" <nrg@nrgconsult .com> wrote in message
                      news:JxIpb.6959 $qh2.2851@newsr ead4.news.pas.e arthlink.net...


                      That could be. It seems clearly to be something with the machine, and that
                      seems a likely explanation.

                      Neil
                      _______________ _______________ _______________

                      Also, have you been able to rule out the possibility of incorrect OLE Automation system
                      files? I was thinking that perhaps this particular PC does not have the Windows XP
                      operating system, but it had some other software installed, which may have installed an
                      incorrect version of the OLE Automation files intended for Windows XP. That scenario may
                      have led to the automation error you reported for your application....


                      Comment

                      • Neil Ginsberg

                        #26
                        Re: Strange Automation Issue

                        > But, I'm still curious if the OLE Automation system files might be the
                        issue. Can you[color=blue]
                        > search for the file named "Oleaut32.d ll" on the PC that is still having[/color]
                        the problem, and[color=blue]
                        > report back which version that it is? Also, which operating system does[/color]
                        this machine[color=blue]
                        > have?[/color]

                        The machine is running Win 98 SE, and the version of Oleaut32 is
                        3.50.5016.0. However, after posting my message last night I realized that it
                        has to be something else. Recall that there was "App A" (original) and "App
                        B" (pared-down copy), and that App A works on that machine, whereas App B
                        doesn't. I did determine while responding to TC that App B used late
                        binding, so I changed it to match App A's early-binding code. After that,
                        the problem shifted a bit so that it does open the Word doc (previously
                        didn't), though it first tells me that it's locked by me; but then fails
                        when setting Word to visible (and Word was already visible).

                        So the bottom line is that App B is having problems (albeit different ones
                        than originally) whereas App A isn't, and they both have the same code and
                        references, from what I can see. So this doesn't make sense. But, if there's
                        any consolation, it would be that App B apparently works fine on all other
                        machines. So go figure......

                        If you want me to look at anything else, let me know.

                        Neil


                        Comment

                        Working...