471,853 Members | 968 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 471,853 software developers and data experts.

Office Automation and late binding

I am sorry for this but I am not getting an answer elsewhere so I thought I
would try here.

It seems the safer way to go prior to deployment is to change my early
binding to late binding to prevent lots of issues occuring, especially those
on Office versions other than mine. (I have 2003). such as

Public WordApp As Object = CreateObject("Word.Application")
Public oDoc As Object = CreateObject("Word.Document")

instead of

'Public WordApp As New Word.Application
'Public oDoc As Word.Document
This occured because late last night a client reported this error

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

Does this mean I can remove the references to the Word object library and
such?

I have run into one issue concerning this.

When I tried to do

Public dlg as Object = Creatobject("Word.Dialog")

instead of

'Public dlg As Word.Dialog

it says it cannot create the active x component. How shall I use late
binding with this?

I much appreciate your answers
Nov 20 '05 #1
8 1460
"scorpion53061" <Its the end of the world as we know it@here.com>
schrieb

I have run into one issue concerning this.

When I tried to do

Public dlg as Object = Creatobject("Word.Dialog")

instead of

'Public dlg As Word.Dialog

it says it cannot create the active x component. How shall I use
late binding with this?


A Word.Dialog is not createable this way, just like you also can't write

dlg = NEW Word.Dialog

You must get the Dialog object from any property of the creatable objects,
like Word.Application. It's Dialogs property returns Dialog objects.
--
Armin

http://www.plig.net/nnq/nquote.html
http://www.netmeister.org/news/learn2quote.html

Nov 20 '05 #2
> You must get the Dialog object from any property of the creatable objects,
like Word.Application. It's Dialogs property returns Dialog objects.

Armin,

In your opinion is it okay to mix early binding and late binding in the same
application?
Nov 20 '05 #3
"scorpion53061" <Its the end of the world as we know it@here.com>
schrieb
You must get the Dialog object from any property of the creatable
objects, like Word.Application. It's Dialogs property returns
Dialog objects.

Armin,

In your opinion is it okay to mix early binding and late binding in
the same application?

I don't know. Probably I won't.

But, (why) do you think it would t solve the problem?
--
Armin

Nov 20 '05 #4
> But, (why) do you think it would t solve the problem?

It did solve the problem.

I was wondering because I have other objects that are taking so long to load
with late binding but were working okay for the client that I didnt want to
switch them over to late binding if I didnt have to.
Nov 20 '05 #5
"scorpion53061" <Its the end of the world as we know it@here.com>
schrieb
But, (why) do you think it would t solve the problem?


It did solve the problem.

??

Your problem was that Creatobject("Word.Dialog") does not work. Now, using
early binding,

New Word.Dialog

works? I don't think so.
--
Armin

http://www.plig.net/nnq/nquote.html
http://www.netmeister.org/news/learn2quote.html

Nov 20 '05 #6
> Your problem was that Creatobject("Word.Dialog") does not work. Now, using
early binding,

New Word.Dialog

works? I don't think so.


Armin,

You are jumping to conclusions or something. I want to keep early binding
for other unrelated database issues.

You should relax a little bit.
Nov 20 '05 #7
"scorpion53061" <Its the end of the world as we know it@here.com>
schrieb
Your problem was that Creatobject("Word.Dialog") does not work.
Now, using early binding,

New Word.Dialog

works? I don't think so.


Armin,

You are jumping to conclusions or something. I want to keep early
binding for other unrelated database issues.

You should relax a little bit.


Me? I relax from time to time.
<you>
I have run into one issue concerning this.

When I tried to do

Public dlg as Object = Creatobject("Word.Dialog")

instead of

'Public dlg As Word.Dialog

it says it cannot create the active x component. How shall I use late
binding with this?
</you>

<me>
A Word.Dialog is not createable this way, just like you also can't write

dlg = NEW Word.Dialog
</me>

<you>
is it okay to mix early binding and late binding in the same
application
</you>

I thought you were referring to my answer (referring to your question
concerning Creatobject("Word.Dialog")). That's why I thought you mean that
mixing early and late binding could solve the problem. You wrote that it
did. As I could (and can) not imagine that it really did, I asked again. If
you were not referring to the initial problem, _you_ have been jumping, not
me. :-)
--
Armin

http://www.plig.net/nnq/nquote.html
http://www.netmeister.org/news/learn2quote.html

Nov 20 '05 #8
> I thought you were referring to my answer (referring to your question
concerning Creatobject("Word.Dialog")). That's why I thought you mean that
mixing early and late binding could solve the problem. You wrote that it
did. As I could (and can) not imagine that it really did, I asked again. If you were not referring to the initial problem, _you_ have been jumping, not me. :-)


Armin,

No I said "jumping to conclusions". Your suggestion was fine for the word
dialog problem. I simply assigned it to the objects event though no
intellisense would help me. There are other issues involved with late
binding, automation and database handling.

I try to keep other issues that i am dealing with out of the question at
hand. My goal is to prevent confusion. But in this case it muddled things
more.

Anyway plesae look in on the thread
Re: removing non traditional text

I would value your input.
Nov 20 '05 #9

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

1 post views Thread by zfeld | last post: by
3 posts views Thread by pontifikas | last post: by
2 posts views Thread by Max | last post: by
5 posts views Thread by John | last post: by
reply views Thread by YellowAndGreen | last post: by
aboka
reply views Thread by aboka | last post: by

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.