Hi
Why do you declare your Word Object as a constant?
I do not see any reason so far with the info you provided.
In addition there is obviously a mistake in this line:
Public Const gobjWordApp as Object
Can you just try and change to:
Public objWordApp As Object
And see if it works?
HTH
Cordially
Pascal
"Marchand" <(E-Mail Removed)> a écrit dans le message de news:
d644ed27-2b60-4db7-afb8-99822ee1c740...oglegroups.com...
> Thanks for your respones, and your questions.
> - I absolutely agree that 1004 isn't a useful error code -- but it's
> the only one Excel's providing.
> - The 'objWordApp' object is declared with a "Public Const gobjWordApp
> as Object" in a separate modeul in the application. Thus it does use
> late binding.
> - The idea of a missing reference is interesting. The "Tools /
> References" within VBE look normal. And I can easily create the Word
> session, just not (always) get it assigned to an Excel variable. Is
> there something I'm missing here, that I'm not checking but should?
>
> / T /
>
> On Apr 2, 5:01 pm, Dave Peterson <peter...@verizonXSPAM.net> wrote:
>> I don't know. But maybe a few more questions/answers will help someone
>> else
>> come up with an idea.
>>
>> How did you declare gobjWordApp?
>>
>> Did you declare it as an object (using late binding) or did you add a
>> reference
>> to that workbook's project--and maybe the reference is missing???
>>
>> What is the error description? 1004 isn't really too helpful.
>>
>>
>>
>> t...@udapps.com wrote:
>>
>> > We have an Excel application which fails for some users, sometimes,
>> > with a 1004 at the line:
>> > Set gobjWordApp = CreateObject("Word.Application")
>> > where gobjWordApp has been defined as an Object.
>> > What's interesting is that the Word session has been started, as per
>> > Task Manager. It isn't visible to the user at that point (as expected)
>> > and the gobjWordApp object is undefined.. So while Word is there, it
>> > looks like the reference/pointer back to VBA simply doesn't occur.
>> > Additional hints: Changing the line to a simple
>> > "CreateObject("Word.Application") works fine -- although it's pretty
>> > useless for the application since there's no addressable object for
>> > VBA to interact with.
>> > Re-installing Office doesn't change anything.
>> > The typical environment is Windows XP/SP2 and Office 2003/SP2 or
>> > SP3.
>> > There doesn't seem to be a particular pattern in terms of who this
>> > works for and who it fails for, although we're getting suspicious of
>> > the new Vista-compatible versions of HP printer drivers.
>> > Has anyone had experience with this kind of problem or, even
>> > better, know of a fix?
>>
>> > / Tyla /
>>
>> --
>>
>> Dave Peterson
>