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