Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Westi on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Warning: Early Binding with Office

Status
Not open for further replies.

JohnYingling

Programmer
Mar 24, 2001
3,742
US
Check out this MSDN link. For all those exporting data to Office, it appears that new versions of Office can break your code if you use early binding.
Click on VB Frequently asked questions.
====================================================================
"If you are developing an Automation client for both Microsoft Access 97 and 2000, you should not use early binding: late binding is recommended. The Access 2000 object model was modified such that it breaks both binary (vtable) and dispid compatibility. Any client application that uses early or dispid binding to Access 97 might fail to work properly when run against Access 2000."
====================================================================

Below is what I use to get the benefits of IntelliSense without using early binding in production.
......
Code:
#If blnDesign then
    Dim objAppl as Word.Application ' Need reference to Type lib
    Dim objDoc  as word.document
#Else
    Dim objAppl as object 
    Dim objDoc  as object
#End if
You can set blnDesign in the Project Properties for the compile or define it in your code.
#Const blnDesign = True ' set to false when production compile
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top