ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   permanent/programmatic changes to VBA Project References (https://www.excelbanter.com/excel-programming/373017-permanent-programmatic-changes-vba-project-references.html)

[email protected]

permanent/programmatic changes to VBA Project References
 
Hey--Is there any way to permanently select certain references from the
VB Project library? I want to be able to always reference microsoft
word at all times in VB, rather than have my users tell the VB editor
that they would like to reference word...

Thanks,
Abe


CBrine[_4_]

permanent/programmatic changes to VBA Project References
 
Have you thought about using late binding instead of early binding? It's
very easy to implement, but could cause problems if the user has an older
version.

Just change all your DIM references for the word object to Object.

ex.
Dim Doc as word.document
To
Dim do as object

HTH
Cal

" wrote:

Hey--Is there any way to permanently select certain references from the
VB Project library? I want to be able to always reference microsoft
word at all times in VB, rather than have my users tell the VB editor
that they would like to reference word...

Thanks,
Abe




CBrine[_4_]

permanent/programmatic changes to VBA Project References
 
Forgot to explain why:-)
When using late binding you don't need to use the reference at all. VB will
automatically pick up the most recent associated object based on the
createObject().

"CBrine" wrote:

Have you thought about using late binding instead of early binding? It's
very easy to implement, but could cause problems if the user has an older
version.

Just change all your DIM references for the word object to Object.

ex.
Dim Doc as word.document
To
Dim do as object

HTH
Cal

" wrote:

Hey--Is there any way to permanently select certain references from the
VB Project library? I want to be able to always reference microsoft
word at all times in VB, rather than have my users tell the VB editor
that they would like to reference word...

Thanks,
Abe




Tom Ogilvy

permanent/programmatic changes to VBA Project References
 
Why do you think latebinding would have problems with older versions. That
is half the reason to use latebinding. What would cause problems is if you
use features not supported in the older version - but that has nothing to do
with latebinding.

--
Regards,
Tom Ogilvy


"CBrine" wrote:

Forgot to explain why:-)
When using late binding you don't need to use the reference at all. VB will
automatically pick up the most recent associated object based on the
createObject().

"CBrine" wrote:

Have you thought about using late binding instead of early binding? It's
very easy to implement, but could cause problems if the user has an older
version.

Just change all your DIM references for the word object to Object.

ex.
Dim Doc as word.document
To
Dim do as object

HTH
Cal

" wrote:

Hey--Is there any way to permanently select certain references from the
VB Project library? I want to be able to always reference microsoft
word at all times in VB, rather than have my users tell the VB editor
that they would like to reference word...

Thanks,
Abe




CBrine[_4_]

permanent/programmatic changes to VBA Project References
 
That's exactly what I was referring to. Sorry if the explanation wasn't
clear enough.

"Tom Ogilvy" wrote:

Why do you think latebinding would have problems with older versions. That
is half the reason to use latebinding. What would cause problems is if you
use features not supported in the older version - but that has nothing to do
with latebinding.

--
Regards,
Tom Ogilvy


"CBrine" wrote:

Forgot to explain why:-)
When using late binding you don't need to use the reference at all. VB will
automatically pick up the most recent associated object based on the
createObject().

"CBrine" wrote:

Have you thought about using late binding instead of early binding? It's
very easy to implement, but could cause problems if the user has an older
version.

Just change all your DIM references for the word object to Object.

ex.
Dim Doc as word.document
To
Dim do as object

HTH
Cal

" wrote:

Hey--Is there any way to permanently select certain references from the
VB Project library? I want to be able to always reference microsoft
word at all times in VB, rather than have my users tell the VB editor
that they would like to reference word...

Thanks,
Abe




Tom Ogilvy

permanent/programmatic changes to VBA Project References
 
I guess if there would be problems regardless of whether you used late or
early binding, then yes, I guess it wasn't just unclear, but misleading.

--
Regards,
Tom Ogilvy


"CBrine" wrote:

That's exactly what I was referring to. Sorry if the explanation wasn't
clear enough.

"Tom Ogilvy" wrote:

Why do you think latebinding would have problems with older versions. That
is half the reason to use latebinding. What would cause problems is if you
use features not supported in the older version - but that has nothing to do
with latebinding.

--
Regards,
Tom Ogilvy


"CBrine" wrote:

Forgot to explain why:-)
When using late binding you don't need to use the reference at all. VB will
automatically pick up the most recent associated object based on the
createObject().

"CBrine" wrote:

Have you thought about using late binding instead of early binding? It's
very easy to implement, but could cause problems if the user has an older
version.

Just change all your DIM references for the word object to Object.

ex.
Dim Doc as word.document
To
Dim do as object

HTH
Cal

" wrote:

Hey--Is there any way to permanently select certain references from the
VB Project library? I want to be able to always reference microsoft
word at all times in VB, rather than have my users tell the VB editor
that they would like to reference word...

Thanks,
Abe




CBrine[_4_]

permanent/programmatic changes to VBA Project References
 
I agree that my incomplete explanation could be misleading to someone who has
never used late binding before. The explanation on resolving the problem the
OP encountered is still valid. I will ensure that the next post I make
within this board is more complete, so there is no confusion on the OP's
part. Once you pointed out the weakness in my explanation on the first post,
what exactly was the second one for? Just for the general, I'm right, you
are wrong? Is that the normal behaviour and attitude of MVP's? I'm here on
a volunteer basis just as you are trying to help people.

"Tom Ogilvy" wrote:

I guess if there would be problems regardless of whether you used late or
early binding, then yes, I guess it wasn't just unclear, but misleading.

--
Regards,
Tom Ogilvy


"CBrine" wrote:

That's exactly what I was referring to. Sorry if the explanation wasn't
clear enough.

"Tom Ogilvy" wrote:

Why do you think latebinding would have problems with older versions. That
is half the reason to use latebinding. What would cause problems is if you
use features not supported in the older version - but that has nothing to do
with latebinding.

--
Regards,
Tom Ogilvy


"CBrine" wrote:

Forgot to explain why:-)
When using late binding you don't need to use the reference at all. VB will
automatically pick up the most recent associated object based on the
createObject().

"CBrine" wrote:

Have you thought about using late binding instead of early binding? It's
very easy to implement, but could cause problems if the user has an older
version.

Just change all your DIM references for the word object to Object.

ex.
Dim Doc as word.document
To
Dim do as object

HTH
Cal

" wrote:

Hey--Is there any way to permanently select certain references from the
VB Project library? I want to be able to always reference microsoft
word at all times in VB, rather than have my users tell the VB editor
that they would like to reference word...

Thanks,
Abe




Tom Ogilvy

permanent/programmatic changes to VBA Project References
 
Merely clarifying that the two are unrelated which you still left as
ambiguous. Perhaps it could be stated differently.

If you want to discuss it, my email isn't hidden.

--
Regards,
Tom Ogilvy







"CBrine" wrote in message
...
I agree that my incomplete explanation could be misleading to someone who
has
never used late binding before. The explanation on resolving the problem
the
OP encountered is still valid. I will ensure that the next post I make
within this board is more complete, so there is no confusion on the OP's
part. Once you pointed out the weakness in my explanation on the first
post,
what exactly was the second one for? Just for the general, I'm right, you
are wrong? Is that the normal behaviour and attitude of MVP's? I'm here
on
a volunteer basis just as you are trying to help people.

"Tom Ogilvy" wrote:

I guess if there would be problems regardless of whether you used late or
early binding, then yes, I guess it wasn't just unclear, but misleading.

--
Regards,
Tom Ogilvy


"CBrine" wrote:

That's exactly what I was referring to. Sorry if the explanation
wasn't
clear enough.

"Tom Ogilvy" wrote:

Why do you think latebinding would have problems with older versions.
That
is half the reason to use latebinding. What would cause problems is
if you
use features not supported in the older version - but that has
nothing to do
with latebinding.

--
Regards,
Tom Ogilvy


"CBrine" wrote:

Forgot to explain why:-)
When using late binding you don't need to use the reference at all.
VB will
automatically pick up the most recent associated object based on
the
createObject().

"CBrine" wrote:

Have you thought about using late binding instead of early
binding? It's
very easy to implement, but could cause problems if the user has
an older
version.

Just change all your DIM references for the word object to
Object.

ex.
Dim Doc as word.document
To
Dim do as object

HTH
Cal

" wrote:

Hey--Is there any way to permanently select certain references
from the
VB Project library? I want to be able to always reference
microsoft
word at all times in VB, rather than have my users tell the VB
editor
that they would like to reference word...

Thanks,
Abe







All times are GMT +1. The time now is 01:38 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com