Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 59
Default Portability of early bound code - clarification

All,

I'm having a few problems getting something clear in my
mind and I hope someone can help.

From my limited experience with VBA and from searching for
help on this it would seem that there's no doubt I should
be early-binding when creating new objects in my code. If
Chip Pearson says "there is never a good reason for not
using early binding", then that's good enough for me. If
necessary, I set a reference to the appropriate library
and off I go!

The problem arises when I try to get another user to
access the same application: it falls over on the
Outlook / VBscript / whatever specific references.
Obviously I can get the user to set a reference manually,
but that would seem to be an admission of defeat.

I thought I might be missing something simple: maybe the
reference is specific to the project, but a simple
experiment disproved that theory.

Every previous article I can find simply re-iterates the
same thing. Always use early-binding.

What am I missing?

Pete
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default Portability of early bound code - clarification

I guess you are missing the articles by Microsoft that suggest you late
bind.

Early binding is excellent during development, but for distribution, late
binding is probably the best bet.

http://support.microsoft.com/default...b;EN-US;244167
INFO: Writing Automation Clients for Multiple Office Versions

http://support.microsoft.com/default...b;en-us;245115
INFO: Using Early Binding and Late Binding in Automation

http://support.microsoft.com/default...b;en-us;247579
INFO: Use DISPID Binding to Automate Office Applications Whenever Possible

Address some of the issues.

If Chip feels that strongly about it, maybe he will post an explanation.

Regards,
Tom Ogilvy

"Pete McCosh" wrote in message
...
All,

I'm having a few problems getting something clear in my
mind and I hope someone can help.

From my limited experience with VBA and from searching for
help on this it would seem that there's no doubt I should
be early-binding when creating new objects in my code. If
Chip Pearson says "there is never a good reason for not
using early binding", then that's good enough for me. If
necessary, I set a reference to the appropriate library
and off I go!

The problem arises when I try to get another user to
access the same application: it falls over on the
Outlook / VBscript / whatever specific references.
Obviously I can get the user to set a reference manually,
but that would seem to be an admission of defeat.

I thought I might be missing something simple: maybe the
reference is specific to the project, but a simple
experiment disproved that theory.

Every previous article I can find simply re-iterates the
same thing. Always use early-binding.

What am I missing?

Pete



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 860
Default Portability of early bound code - clarification

Hi Pete,

I'm not Chip Pearson, but FWIW, I agree with Tom. For development, Early
Binding is great because you get Intellisense, the Object Browser, etc. And
I use it when I *know* the environment will be a controlled one. For
example, a developer in an internal IT department may be able to count on
the fact that everyone will have Outlook 2002 installed. In that case,
Early Binding may be the way to go, as it is faster than Late Binding.

But in a distributed application or when you can't be sure that all users
will be using the same version of a library, Late Binding is the best choice
IMO; you can trap runtime error 429, which occurs if the user doesn't have a
particular library on his/her machine. With Early Binding, the user gets an
untrappable (read: ugly) error.

--
Regards,

Jake Marx
MS MVP - Excel
www.longhead.com

[please keep replies in the newsgroup - email address unmonitored]


Pete McCosh wrote:
All,

I'm having a few problems getting something clear in my
mind and I hope someone can help.

From my limited experience with VBA and from searching for
help on this it would seem that there's no doubt I should
be early-binding when creating new objects in my code. If
Chip Pearson says "there is never a good reason for not
using early binding", then that's good enough for me. If
necessary, I set a reference to the appropriate library
and off I go!

The problem arises when I try to get another user to
access the same application: it falls over on the
Outlook / VBscript / whatever specific references.
Obviously I can get the user to set a reference manually,
but that would seem to be an admission of defeat.

I thought I might be missing something simple: maybe the
reference is specific to the project, but a simple
experiment disproved that theory.

Every previous article I can find simply re-iterates the
same thing. Always use early-binding.

What am I missing?

Pete


  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 172
Default Portability of early bound code - clarification

A few more links that may prove helpful.

A Primer on Early Binding (or How to Make Automation Faster)
http://msdn.microsoft.com/workshop/b...node_entry.asp

Early vs. Late Binding
http://www.mvps.org/word/FAQs/InterD...ateBinding.htm

http://groups.google.com/groups?hl=e...13026d8&rnum=2

HTH
Paul
--------------------------------------------------------------------------------------------------------------
Be advised to back up your WorkBook before attempting to make changes.
--------------------------------------------------------------------------------------------------------------

All,

I'm having a few problems getting something clear in my
mind and I hope someone can help.

From my limited experience with VBA and from searching for
help on this it would seem that there's no doubt I should
be early-binding when creating new objects in my code. If
Chip Pearson says "there is never a good reason for not
using early binding", then that's good enough for me. If
necessary, I set a reference to the appropriate library
and off I go!

The problem arises when I try to get another user to
access the same application: it falls over on the
Outlook / VBscript / whatever specific references.
Obviously I can get the user to set a reference manually,
but that would seem to be an admission of defeat.

I thought I might be missing something simple: maybe the
reference is specific to the project, but a simple
experiment disproved that theory.

Every previous article I can find simply re-iterates the
same thing. Always use early-binding.

What am I missing?

Pete


  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 59
Default Portability of early bound code - clarification

Chaps,

thanks for the pointers, there was some interesting stuff
in there and I eventually found my way back to a pretty
involved thread from a year or two ago which went into a
lot more depth than I needed about the differences!

Bizarrely, I'd read the last parts of it when searching
before, but there hadn't been any link to earlier posts in
the thread. Oh well, must be one of the mysteries of
Google.

Thanks again, Pete.

-----Original Message-----
I guess you are missing the articles by Microsoft that

suggest you late
bind.

Early binding is excellent during development, but for

distribution, late
binding is probably the best bet.

http://support.microsoft.com/default.aspx?scid=kb;EN-

US;244167
INFO: Writing Automation Clients for Multiple Office

Versions

http://support.microsoft.com/default.aspx?scid=kb;en-

us;245115
INFO: Using Early Binding and Late Binding in Automation

http://support.microsoft.com/default.aspx?scid=kb;en-

us;247579
INFO: Use DISPID Binding to Automate Office Applications

Whenever Possible

Address some of the issues.

Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Pulling a # from a sheet bound text string Arturo Excel Worksheet Functions 10 April 8th 08 02:51 PM
PORTABILITY ISSUES with Excel Addin in VBA Sandeep Excel Discussion (Misc queries) 3 July 10th 07 05:06 PM
What does "Workbook has no bound sheets" mean? robinsgate Excel Discussion (Misc queries) 1 January 12th 06 06:20 AM
macros, selfcert, portability George Excel Discussion (Misc queries) 0 October 31st 05 05:10 AM
What does "Workbook has no bound sheets" mean? robinsgate Excel Discussion (Misc queries) 1 March 15th 05 11:02 PM


All times are GMT +1. The time now is 04:36 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"