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


Groups > microsoft.public.excel.programming > #108688 > unrolled thread

Can't find project or library

Started byhbj <hakan.bjorkstrom@gmail.com>
First post2016-04-04 04:17 -0700
Last post2016-04-06 11:50 +0100
Articles 17 — 4 participants

Back to article view | Back to microsoft.public.excel.programming


Contents

  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

#108688 — Can't find project or library

Fromhbj <hakan.bjorkstrom@gmail.com>
Date2016-04-04 04:17 -0700
SubjectCan't find project or library
Message-ID<7428ef6c-a205-4e41-8b6d-0782551c8c87@googlegroups.com>
I had to change my computer and therefor reinstall Office 2007. I have an Excel project I am unable to run now due to the message above. Often the macro stops at an undefined variable, when i "Dim" the variable macro continues. I cannot see call-stack (probaly because fields are updated using the macros). The macro also can stop at TRIM.
I do not remember which libraries were loaded in the old broken PC.
Can anyone give any hint?
Thanks in advance
Håkan

[toc] | [next] | [standalone]


#108689

Fromisabelle <i@v.invalid>
Date2016-04-04 07:36 -0400
Message-ID<ndtjlh$19kd$1@gioia.aioe.org>
In reply to#108688
hi,

http://www.cpearson.com/excel/missingreferences.aspx

isabelle

Le 2016-04-04 07:17, hbj a écrit :
> I had to change my computer and therefor reinstall Office 2007. I have an
> Excel project I am unable to run now due to the message above. Often the
> macro stops at an undefined variable, when i "Dim" the variable macro
> continues. I cannot see call-stack (probaly because fields are updated using
> the macros). The macro also can stop at TRIM. I do not remember which
> libraries were loaded in the old broken PC. Can anyone give any hint? Thanks
> in advance Håkan
>

[toc] | [prev] | [next] | [standalone]


#108690

FromGS <gs@v.invalid>
Date2016-04-04 12:47 -0400
Message-ID<ndu5lb$gbd$1@dont-email.me>
In reply to#108688
> Often the macro stops at an undefined variable, when i "Dim" the 
> variable macro continues.

Variable declaration should set to 'Required' just as a *best 
practice*. This can be set on the Editor tab of the VBE Options 
dialog...

-- 
Garry

Free usenet access at http://www.eternal-september.org
Classic VB Users Regroup!
  comp.lang.basic.visual.misc
  microsoft.public.vb.general.discussion

[toc] | [prev] | [next] | [standalone]


#108691

Fromhbj <hakan.bjorkstrom@gmail.com>
Date2016-04-04 12:11 -0700
Message-ID<71baaa6c-546b-4337-b4ab-c0ebd407167b@googlegroups.com>
In reply to#108690
On Monday, April 4, 2016 at 7:47:48 PM UTC+3, GS wrote:
> > Often the macro stops at an undefined variable, when i "Dim" the 
> > variable macro continues.
> 
> Variable declaration should set to 'Required' just as a *best 
> practice*. This can be set on the Editor tab of the VBE Options 
> dialog...
> 
> -- 
> Garry
> 
> Free usenet access at http://www.eternal-september.org
> Classic VB Users Regroup!
>   comp.lang.basic.visual.misc
>   microsoft.public.vb.general.discussion

Yes Garry I know ;)

I got the file into a state I can see what libraries are missing: ADO Library 6.1. I downloaded it from MS website but it wouldn't install. Reads something like "Searching for updates on this computer".

Håkan

[toc] | [prev] | [next] | [standalone]


#108692

FromGS <gs@v.invalid>
Date2016-04-04 15:52 -0400
Message-ID<ndugfl$v50$1@dont-email.me>
In reply to#108691
> On Monday, April 4, 2016 at 7:47:48 PM UTC+3, GS wrote:
>>> Often the macro stops at an undefined variable, when i "Dim" the 
>>> variable macro continues.
>> 
>> Variable declaration should set to 'Required' just as a *best 
>> practice*. This can be set on the Editor tab of the VBE Options 
>> dialog...
>> 
>> -- 
>> Garry
>> 
>> Free usenet access at http://www.eternal-september.org
>> Classic VB Users Regroup!
>>   comp.lang.basic.visual.misc
>>   microsoft.public.vb.general.discussion
>
> Yes Garry I know ;)
>
> I got the file into a state I can see what libraries are missing: ADO 
> Library 6.1. I downloaded it from MS website but it wouldn't install. 
> Reads something like "Searching for updates on this computer".
>
> Håkan

You could change your ref to whatever version was installed with your 
OS. This Win7 Pro machine, for example, has Microsoft Active Data 
Object 2.5 installed. Don't know what ADO Library 6.1 is but sounds (by 
its name) 3rd party. Better, IMO, to stick with intrinsic libs 
otherwise every machine using your project will need the 3rd party lib 
as well. (Bit of a PITA, no!)

-- 
Garry

Free usenet access at http://www.eternal-september.org
Classic VB Users Regroup!
  comp.lang.basic.visual.misc
  microsoft.public.vb.general.discussion

[toc] | [prev] | [next] | [standalone]


#108694

From"Peter T" <askformy@gmail.com>
Date2016-04-04 23:24 +0100
Message-ID<ndupbu$5al$1@dont-email.me>
In reply to#108692
"GS" <gs@v.invalid> wrote in message
>>
>> I got the file into a state I can see what libraries are missing: ADO 
>> Library 6.1. I downloaded it from MS website but it wouldn't install. 
>> Reads something like "Searching for updates on this computer".
>>
>> Håkan
>
> You could change your ref to whatever version was installed with your OS. 
> This Win7 Pro machine, for example, has Microsoft Active Data Object 2.5 
> installed. Don't know what ADO Library 6.1 is but sounds (by its name) 3rd 
> party. Better, IMO, to stick with intrinsic libs otherwise every machine 
> using your project will need the 3rd party lib as well. (Bit of a PITA, 
> no!)

Gary, ADO Library 6.1 is the current version of MS ActiveX Data Object for 
Win7. Your 2.5 is a very old version.

Håkan, which OS do you have, if XP 6.1 won't install, get 2.8. If that's 
already installed untick the missing 6.1 and tick the 2.8. If Vista untick 
the 6.1 and tick 6.0 if installed (6.0 is the equivalent of 2.8)

https://blogs.msdn.microsoft.com/psssql/2011/10/02/a-better-solution-for-the-windows-7-sp1-ado-guid-changes/

Peter T




[toc] | [prev] | [next] | [standalone]


#108696

FromGS <gs@v.invalid>
Date2016-04-04 18:50 -0400
Message-ID<nduqt9$9tc$1@dont-email.me>
In reply to#108694
> Gary, ADO Library 6.1 is the current version of MS ActiveX Data 
> Object for Win7. Your 2.5 is a very old version.

Thanks, Peter. I have never installed any ado libs on this machine 
deliberately, so I assume some software did this. Also, I have no 
listings for any other versions and so if they should be there then 
perhaps I have a similar situation to the 'missing' components 
mentioned in the VB6 forum. I say this because all the newer versions 
are in the folder with 2.5 but they won't register because their 'entry 
point server' is missing. Looks like I need to find replacements...

-- 
Garry

Free usenet access at http://www.eternal-september.org
Classic VB Users Regroup!
  comp.lang.basic.visual.misc
  microsoft.public.vb.general.discussion

[toc] | [prev] | [next] | [standalone]


#108698

From"Peter T" <askformy@gmail.com>
Date2016-04-05 00:26 +0100
Message-ID<ndusvs$fuv$1@dont-email.me>
In reply to#108696
"GS" <gs@v.invalid> wrote in message
>> Gary, ADO Library 6.1 is the current version of MS ActiveX Data Object 
>> for Win7. Your 2.5 is a very old version.
>
> Thanks, Peter. I have never installed any ado libs on this machine 
> deliberately, so I assume some software did this. Also, I have no listings 
> for any other versions and so if they should be there then perhaps I have 
> a similar situation to the 'missing' components mentioned in the VB6 
> forum. I say this because all the newer versions are in the folder with 
> 2.5 but they won't register because their 'entry point server' is missing. 
> Looks like I need to find replacements...

Distributing with the ADO reference can be problematic because as you say, 
the entry point is different in respective versions, not even backwards 
compatible (IOW not compiled as binary compatible). I don't use it much 
myself but AIUI safer to develop with early binding, then before 
distributing adapt to late binding and remove the reference.

On which point, Håkan it might be worth adapting your project to late 
binding, then it'll probably pick up whatever ADO version is installed, even 
Garry's 2.5!  (assuming not using any methods only available in the later 
version)

Peter T 

[toc] | [prev] | [next] | [standalone]


#108699

FromGS <gs@v.invalid>
Date2016-04-04 20:00 -0400
Message-ID<nduv1a$lnf$1@dont-email.me>
In reply to#108698
> "GS" <gs@v.invalid> wrote in message
>>> Gary, ADO Library 6.1 is the current version of MS ActiveX Data 
>>> Object for Win7. Your 2.5 is a very old version.
>>
>> Thanks, Peter. I have never installed any ado libs on this machine 
>> deliberately, so I assume some software did this. Also, I have no 
>> listings for any other versions and so if they should be there then 
>> perhaps I have a similar situation to the 'missing' components 
>> mentioned in the VB6 forum. I say this because all the newer 
>> versions are in the folder with 2.5 but they won't register because 
>> their 'entry point server' is missing. Looks like I need to find 
>> replacements...
>
> Distributing with the ADO reference can be problematic because as you 
> say, the entry point is different in respective versions, not even 
> backwards compatible (IOW not compiled as binary compatible). I don't 
> use it much myself but AIUI safer to develop with early binding, then 
> before distributing adapt to late binding and remove the reference.
>
> On which point, Håkan it might be worth adapting your project to late 
> binding, then it'll probably pick up whatever ADO version is 
> installed, even Garry's 2.5!  (assuming not using any methods only 
> available in the later version)
>
> Peter T

Interesting!
After opening all the ADO libs and getting the error meg, they're all 
now listed in References (even 6.1)!!! weird...

-- 
Garry

Free usenet access at http://www.eternal-september.org
Classic VB Users Regroup!
  comp.lang.basic.visual.misc
  microsoft.public.vb.general.discussion

[toc] | [prev] | [next] | [standalone]


#108701

Fromhbj <hakan.bjorkstrom@gmail.com>
Date2016-04-05 05:17 -0700
Message-ID<bb8f8656-6427-4e9f-ab02-f5127e3d9593@googlegroups.com>
In reply to#108699
On Tuesday, April 5, 2016 at 3:00:52 AM UTC+3, GS wrote:
> > "GS" <gs@v.invalid> wrote in message
> >>> Gary, ADO Library 6.1 is the current version of MS ActiveX Data 
> >>> Object for Win7. Your 2.5 is a very old version.
> >>
> >> Thanks, Peter. I have never installed any ado libs on this machine 
> >> deliberately, so I assume some software did this. Also, I have no 
> >> listings for any other versions and so if they should be there then 
> >> perhaps I have a similar situation to the 'missing' components 
> >> mentioned in the VB6 forum. I say this because all the newer 
> >> versions are in the folder with 2.5 but they won't register because 
> >> their 'entry point server' is missing. Looks like I need to find 
> >> replacements...
> >
> > Distributing with the ADO reference can be problematic because as you 
> > say, the entry point is different in respective versions, not even 
> > backwards compatible (IOW not compiled as binary compatible). I don't 
> > use it much myself but AIUI safer to develop with early binding, then 
> > before distributing adapt to late binding and remove the reference.
> >
> > On which point, Håkan it might be worth adapting your project to late 
> > binding, then it'll probably pick up whatever ADO version is 
> > installed, even Garry's 2.5!  (assuming not using any methods only 
> > available in the later version)
> >
> > Peter T
> 
> Interesting!
> After opening all the ADO libs and getting the error meg, they're all 
> now listed in References (even 6.1)!!! weird...
> 
> -- 
> Garry
> 
> Free usenet access at http://www.eternal-september.org
> Classic VB Users Regroup!
>   comp.lang.basic.visual.misc
>   microsoft.public.vb.general.discussion

Peter, I use Windows 7 Enterprise 32-bit and Office 2007 Pro. At the moment VBA requires (MISSING) "Microsoft ActiveX data Objects 6.1" located in C:\Program Files (x86)\Common Files\System\ado. (msado15.dll) One version of msado15.dll locates in "Program Files\..." but is that a correct dll? Which version should I use and where can I find teh correct version?

Håkan

[toc] | [prev] | [next] | [standalone]


#108702

From"Peter T" <askformy@gmail.com>
Date2016-04-05 13:55 +0100
Message-ID<ne0cdl$qi6$1@dont-email.me>
In reply to#108701
"hbj" <hakan.bjorkstrom@gmail.com> wrote in message >
> Interesting!
> After opening all the ADO libs and getting the error meg, they're all
> now listed in References (even 6.1)!!! weird...
>
> -- 
> Garry
>
> Free usenet access at http://www.eternal-september.org
> Classic VB Users Regroup!
>   comp.lang.basic.visual.misc
>   microsoft.public.vb.general.discussion

"
Peter, I use Windows 7 Enterprise 32-bit and Office 2007 Pro. At the moment 
VBA requires (MISSING) "Microsoft ActiveX data Objects 6.1" located in 
C:\Program Files (x86)\Common Files\System\ado. (msado15.dll) One version of 
msado15.dll locates in "Program Files\..." but is that a correct dll? Which 
version should I use and where can I find teh correct version?
"

It might be 6.1, though msado15.dll is also 6.0 and 2.8 as there's nothing 
new in terms of public methods. Right click it, Properties, Details and look 
at File version and Product version. Try removing the MISSING reference, 
then browse to your msado15.dll and see if you can add it.

BTW your Win7, is that SPI? If so maybe the dll is not fully installed. If 
not SPI your dll is probably 6.0. Apart from that maybe there's something in 
common in your setup with what Garry described which I can't replicate.

As I mentioned before, consider coverting your project to Late Binding.

Peter T




[toc] | [prev] | [next] | [standalone]


#108703

FromGS <gs@v.invalid>
Date2016-04-05 09:41 -0400
Message-ID<ne0f3m$58b$1@dont-email.me>
In reply to#108702
FYI:
I have Win7 Pro x64 on this machine. I also see 2.8/6.0 Recordset and 
Multi-dimensional TLBs. I believe the 6.1 tlb is the fix mentioned in 
your link article.

Any projects I would have used ADODB with were dev'd on my XP machine 
with then current 2.5 which I have not bothered to update because that 
project is no longer Excel-based. (Now VB6.exe using fpSpread.ocx)

-- 
Garry

Free usenet access at http://www.eternal-september.org
Classic VB Users Regroup!
  comp.lang.basic.visual.misc
  microsoft.public.vb.general.discussion

[toc] | [prev] | [next] | [standalone]


#108704

From"Peter T" <askformy@gmail.com>
Date2016-04-05 15:59 +0100
Message-ID<ne0jl6$n7b$1@dont-email.me>
In reply to#108702
"Peter T" <askformy@gmail.com> wrote in message >
> "
> Peter, I use Windows 7 Enterprise 32-bit and Office 2007 Pro. At the 
> moment VBA requires (MISSING) "Microsoft ActiveX data Objects 6.1" located 
> in C:\Program Files (x86)\Common Files\System\ado. (msado15.dll) One 
> version of msado15.dll locates in "Program Files\..." but is that a 
> correct dll? Which version should I use and where can I find teh correct 
> version?
> "
>
> It might be 6.1, though msado15.dll is also 6.0 and 2.8 as there's nothing 
> new in terms of public methods. Right click it, Properties, Details and 
> look at File version and Product version. Try removing the MISSING 
> reference, then browse to your msado15.dll and see if you can add it.

If you can't, simplest might be just to reinstall 6.1
https://support.microsoft.com/en-us/kb/2640696   x86 for Win7

You may need to remove and re-add the reference

Peter T

[toc] | [prev] | [next] | [standalone]


#108705

Fromhbj <hakan.bjorkstrom@gmail.com>
Date2016-04-05 10:49 -0700
Message-ID<95d4669b-f928-4eb3-bfb2-96ede6e648bb@googlegroups.com>
In reply to#108704
On Tuesday, April 5, 2016 at 5:58:57 PM UTC+3, Peter T wrote:
> "Peter T" <askformy@gmail.com> wrote in message >
> > "
> > Peter, I use Windows 7 Enterprise 32-bit and Office 2007 Pro. At the 
> > moment VBA requires (MISSING) "Microsoft ActiveX data Objects 6.1" located 
> > in C:\Program Files (x86)\Common Files\System\ado. (msado15.dll) One 
> > version of msado15.dll locates in "Program Files\..." but is that a 
> > correct dll? Which version should I use and where can I find teh correct 
> > version?
> > "
> >
> > It might be 6.1, though msado15.dll is also 6.0 and 2.8 as there's nothing 
> > new in terms of public methods. Right click it, Properties, Details and 
> > look at File version and Product version. Try removing the MISSING 
> > reference, then browse to your msado15.dll and see if you can add it.
> 
> If you can't, simplest might be just to reinstall 6.1
> https://support.microsoft.com/en-us/kb/2640696   x86 for Win7
> 
> You may need to remove and re-add the reference
> 
> Peter T

SOLVED!
Thank you!

I found 2 files msado15.dll, one created 2009 and one 2010, neither of those accepted. I simply changed to ado28 which was listed in available reference list. What I'm still wondering, how on earth VBA engine complains about ADO in a statement with common command TRIM(....)? This only didn't give me any information on what is missing, least that ADO is missing???

Håkan

[toc] | [prev] | [next] | [standalone]


#108706

From"Peter T" <askformy@gmail.com>
Date2016-04-05 19:15 +0100
Message-ID<ne0v57$7v6$1@dont-email.me>
In reply to#108705
"hbj" <hakan.bjorkstrom@gmail.com> wrote in message
On Tuesday, April 5, 2016 at 5:58:57 PM UTC+3, Peter T wrote:
> "Peter T" <askformy@gmail.com> wrote in message >
> > "
> > Peter, I use Windows 7 Enterprise 32-bit and Office 2007 Pro. At the
> > moment VBA requires (MISSING) "Microsoft ActiveX data Objects 6.1" 
> > located
> > in C:\Program Files (x86)\Common Files\System\ado. (msado15.dll) One
> > version of msado15.dll locates in "Program Files\..." but is that a
> > correct dll? Which version should I use and where can I find teh correct
> > version?
> > "
> >
> > It might be 6.1, though msado15.dll is also 6.0 and 2.8 as there's 
> > nothing
> > new in terms of public methods. Right click it, Properties, Details and
> > look at File version and Product version. Try removing the MISSING
> > reference, then browse to your msado15.dll and see if you can add it.
>
> If you can't, simplest might be just to reinstall 6.1
> https://support.microsoft.com/en-us/kb/2640696   x86 for Win7
>
> You may need to remove and re-add the reference
>
> Peter T

"
SOLVED!
Thank you!

I found 2 files msado15.dll, one created 2009 and one 2010, neither of those 
accepted. I simply changed to ado28 which was listed in available reference 
list.
"

Sure, the 2.8 would most likely work or even 2.5, but why not install the 
6.1 (via the link above)

"What I'm still wondering, how on earth VBA engine complains about ADO in a 
statement with common command TRIM(....)? "

Whenever there are any MISSING references String and DateTime functions are 
particularly likely to fail unless fully qualified to the respective 
library, eg
VBA.Strings.Trim()

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.

Peter T 

[toc] | [prev] | [next] | [standalone]


#108707

Fromhbj <hakan.bjorkstrom@gmail.com>
Date2016-04-05 11:48 -0700
Message-ID<59856afd-4065-4cc6-9b2f-acdbb0b87cf4@googlegroups.com>
In reply to#108706
On Tuesday, April 5, 2016 at 9:15:13 PM UTC+3, Peter T wrote:
> "hbj" <hakan.bjorkstrom@gmail.com> wrote in message
> On Tuesday, April 5, 2016 at 5:58:57 PM UTC+3, Peter T wrote:
> > "Peter T" <askformy@gmail.com> wrote in message >
> > > "
> > > Peter, I use Windows 7 Enterprise 32-bit and Office 2007 Pro. At the
> > > moment VBA requires (MISSING) "Microsoft ActiveX data Objects 6.1" 
> > > located
> > > in C:\Program Files (x86)\Common Files\System\ado. (msado15.dll) One
> > > version of msado15.dll locates in "Program Files\..." but is that a
> > > correct dll? Which version should I use and where can I find teh correct
> > > version?
> > > "
> > >
> > > It might be 6.1, though msado15.dll is also 6.0 and 2.8 as there's 
> > > nothing
> > > new in terms of public methods. Right click it, Properties, Details and
> > > look at File version and Product version. Try removing the MISSING
> > > reference, then browse to your msado15.dll and see if you can add it.
> >
> > If you can't, simplest might be just to reinstall 6.1
> > https://support.microsoft.com/en-us/kb/2640696   x86 for Win7
> >
> > You may need to remove and re-add the reference
> >
> > Peter T
> 
> "
> SOLVED!
> Thank you!
> 
> I found 2 files msado15.dll, one created 2009 and one 2010, neither of those 
> accepted. I simply changed to ado28 which was listed in available reference 
> list.
> "
> 
> Sure, the 2.8 would most likely work or even 2.5, but why not install the 
> 6.1 (via the link above)
> 
> "What I'm still wondering, how on earth VBA engine complains about ADO in a 
> statement with common command TRIM(....)? "
> 
> Whenever there are any MISSING references String and DateTime functions are 
> particularly likely to fail unless fully qualified to the respective 
> library, eg
> VBA.Strings.Trim()

Ok, a little bit strange behavior, would expect the statement/command using that missing lib to trig the 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.
> 
> Peter T

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

Rgds Håkan

[toc] | [prev] | [next] | [standalone]


#108708

From"Peter T" <askformy@gmail.com>
Date2016-04-06 11:50 +0100
Message-ID<ne2pfi$5jj$1@dont-email.me>
In reply to#108707
"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 

[toc] | [prev] | [standalone]


Back to top | Article view | microsoft.public.excel.programming


csiph-web