Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 162
Default Can't find project or library


"hbj" wrote in message
Keep in mind if your file is ever loaded on a system without the 2.8 it
will
fail again. Late Binding would usually avoid these problems.


"Late Binding/Early Binding. I'm sorry not understanding those methods."

The reference to the library in Tools/References "early" binds the the
library. It loads faster and gives all the intelisense and named constants,
useful while developing. Problems can occur when distributing the project if
the version of referenced object library is different. Hence develop with
the reference, distribute without the reference. Without the reference all
object references should be declared 'As Object', and any named constants
should be replaced with their intinsic values. The project can include code
that handles both methods, eg

In Project Properties, Conditional Compilation Arguments,
LateB = 0

#If LateB Then
' include ADODB constants used in the project
Public Const adLockReadOnly As Long = 1
#End If

Sub test()
#If LateB Then
Dim rsCon As Object
Dim rsData As Object
#Else
Dim rsCon As ADODB.Connection
Dim rsData As ADODB.Recordset
#End If

' code

#If LateB Then
Set rsCon = CreateObject("ADODB.Connection")
Set rsData = CreateObject("ADODB.Recordset")
#Else
Set rsCon = New ADODB.Connection
Set rsData = New ADODB.Recordset
#End If

' code

End Sub

Adapt the code as above for object variables and include any named constants
also as above.

Head all modules Option Explicit and do Debug/Compile, test the code

Then test as Late Binding: change the conditional constant to LateB = 1,
remove the ADO reference in tools/refs, again do Debug/Compile, test the
code.

In theory Early Binding is much faster, but in practice typically won't
notice any difference with Late Binding

Peter T


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
VBA - Cannot find project or library Goodenuff Excel Programming 2 January 15th 09 05:43 PM
Can't find project of library MG Excel Discussion (Misc queries) 3 May 19th 08 12:06 AM
Can't find project or library AnnapolisStar Excel Worksheet Functions 1 June 15th 07 04:02 PM
Can't find project or library Tyrone Excel Programming 0 December 19th 06 02:57 AM
Can't find project or library Roy[_5_] Excel Programming 2 February 22nd 04 03:48 PM


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

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

About Us

"It's about Microsoft Excel"