Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > microsoft.public.excel.programming > #108708

Re: Can't find project or library

From "Peter T" <askformy@gmail.com>
Newsgroups microsoft.public.excel.programming
Subject Re: Can't find project or library
Date 2016-04-06 11:50 +0100
Organization A noiseless patient Spider
Message-ID <ne2pfi$5jj$1@dont-email.me> (permalink)
References (9 earlier) <ne0cdl$qi6$1@dont-email.me> <ne0jl6$n7b$1@dont-email.me> <95d4669b-f928-4eb3-bfb2-96ede6e648bb@googlegroups.com> <ne0v57$7v6$1@dont-email.me> <59856afd-4065-4cc6-9b2f-acdbb0b87cf4@googlegroups.com>

Show all headers | View raw


"hbj" <hakan.bjorkstrom@gmail.com> 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 

Back to microsoft.public.excel.programming | Previous | NextPrevious in thread | Find similar | Unroll thread


Thread

Can't find project or library hbj <hakan.bjorkstrom@gmail.com> - 2016-04-04 04:17 -0700
  Re: Can't find project or library isabelle <i@v.invalid> - 2016-04-04 07:36 -0400
  Re: Can't find project or library GS <gs@v.invalid> - 2016-04-04 12:47 -0400
    Re: Can't find project or library hbj <hakan.bjorkstrom@gmail.com> - 2016-04-04 12:11 -0700
      Re: Can't find project or library GS <gs@v.invalid> - 2016-04-04 15:52 -0400
        Re: Can't find project or library "Peter T" <askformy@gmail.com> - 2016-04-04 23:24 +0100
          Re: Can't find project or library GS <gs@v.invalid> - 2016-04-04 18:50 -0400
            Re: Can't find project or library "Peter T" <askformy@gmail.com> - 2016-04-05 00:26 +0100
              Re: Can't find project or library GS <gs@v.invalid> - 2016-04-04 20:00 -0400
                Re: Can't find project or library hbj <hakan.bjorkstrom@gmail.com> - 2016-04-05 05:17 -0700
                Re: Can't find project or library "Peter T" <askformy@gmail.com> - 2016-04-05 13:55 +0100
                Re: Can't find project or library GS <gs@v.invalid> - 2016-04-05 09:41 -0400
                Re: Can't find project or library "Peter T" <askformy@gmail.com> - 2016-04-05 15:59 +0100
                Re: Can't find project or library hbj <hakan.bjorkstrom@gmail.com> - 2016-04-05 10:49 -0700
                Re: Can't find project or library "Peter T" <askformy@gmail.com> - 2016-04-05 19:15 +0100
                Re: Can't find project or library hbj <hakan.bjorkstrom@gmail.com> - 2016-04-05 11:48 -0700
                Re: Can't find project or library "Peter T" <askformy@gmail.com> - 2016-04-06 11:50 +0100

csiph-web