By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
459,654 Members | 1,599 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 459,654 IT Pros & Developers. It's quick & easy.

Late Binding??

P: n/a
I have this:
Dim Cbr As Object
Dim Ctl As Object
Set Cbr = Application.Commandbars("CourseCalendarMonth")
Set Ctl =
Application.Commandbars("CourseCalendarMonth").Con trols("CalendarMonth")
Is this considered late binding? If not, what needs changed?

Thanks!

Steve
Nov 13 '05 #1
Share this Question
Share on Google+
7 Replies


P: n/a
Yes, that's late binding.

--
Doug Steele, Microsoft Access MVP
http://I.Am/DougSteele
(no e-mails, please!)

"PC Datasheet" <no****@nospam.spam> wrote in message
news:1d*****************@newsread2.news.atl.earthl ink.net...
I have this:
Dim Cbr As Object
Dim Ctl As Object
Set Cbr = Application.Commandbars("CourseCalendarMonth")
Set Ctl =
Application.Commandbars("CourseCalendarMonth").Con trols("CalendarMonth")
Is this considered late binding? If not, what needs changed?

Thanks!

Steve

Nov 13 '05 #2

P: n/a
I stand corrected.

In some earlier threads, I'd said you needed to use CreateObject in this
case.
For some reason, I thought that you needed the Office Objects Library to
access CommandBar items programmatically. I just tried that out and
realized I was wrong on that.

I've lost track of who the OP was on this -
the issue seemed to be running this code on machines using different
versions of Access.
There was a reference to a specific version of the Office Objects
Library; it would still be my guess that this reference would not port well
to an earlier version of Access.
If this reference is not needed for other reasons, it should be removed.
If it's needed somewhere else, that place is probably where we need to
look for the problem.

- Turtle

"Douglas J. Steele" <NOSPAM_djsteele@NOSPAM_canada.com> wrote in message
news:zM********************@rogers.com...
Yes, that's late binding.

--
Doug Steele, Microsoft Access MVP
http://I.Am/DougSteele
(no e-mails, please!)

"PC Datasheet" <no****@nospam.spam> wrote in message
news:1d*****************@newsread2.news.atl.earthl ink.net...
I have this:
Dim Cbr As Object
Dim Ctl As Object
Set Cbr = Application.Commandbars("CourseCalendarMonth")
Set Ctl =
Application.Commandbars("CourseCalendarMonth").Con trols("CalendarMonth")
Is this considered late binding? If not, what needs changed?

Thanks!

Steve


Nov 13 '05 #3

P: n/a
<< I thought that you needed the Office Objects Library to access
CommandBar items programmatically >>
You do if you use:
Dim Cbr As CommandBar
Dim Ctl As Commandbar.Control
I have Office97, 2000 and XP installed and only have Microsoft Office10
Library in my references. Apparently when later versions of Office are
installed, they remove previous versions of the Microsoft Office Library.
I'm creating an Access97 application that needs to manipulate a commandbar
and the controls on the commandbar. That's the reason for all my questions.
The end user of this application will only have MS Office97 installed and
thus Microsoft Office 8 Library in his references. Since I don't have that
reference, I went to late binding with:
Dim Cbr As Object
Dim Ctl As Object

<<it would still be my guess that this reference (Microsoft Office10
Library) would not port well to an earlier version of Access.>>
I think you are very right about this! Upon closer examination, the path to
Microsoft Office10 Library on my computer is:
C:\Program Files\Common Files\Microsoft Shared\Office 10\mso.dll
I presume that the path to references is carried with the database for all
checked references. Therefore, I must assume that the other machine would
never be able to find the Microsoft Office10 Library (mso.dll) because it is
an Office 8 machine and would not even have an Office 10 folder.

Steve

"MacDermott" <ma********@nospam.com> wrote in message
news:0U*****************@newsread2.news.atl.earthl ink.net...
I stand corrected.

In some earlier threads, I'd said you needed to use CreateObject in this
case.
For some reason, I thought that you needed the Office Objects Library to
access CommandBar items programmatically. I just tried that out and
realized I was wrong on that.

I've lost track of who the OP was on this -
the issue seemed to be running this code on machines using different
versions of Access.
There was a reference to a specific version of the Office Objects
Library; it would still be my guess that this reference would not port well to an earlier version of Access.
If this reference is not needed for other reasons, it should be removed. If it's needed somewhere else, that place is probably where we need to
look for the problem.

- Turtle

"Douglas J. Steele" <NOSPAM_djsteele@NOSPAM_canada.com> wrote in message
news:zM********************@rogers.com...
Yes, that's late binding.

--
Doug Steele, Microsoft Access MVP
http://I.Am/DougSteele
(no e-mails, please!)

"PC Datasheet" <no****@nospam.spam> wrote in message
news:1d*****************@newsread2.news.atl.earthl ink.net...
I have this:
Dim Cbr As Object
Dim Ctl As Object
Set Cbr = Application.Commandbars("CourseCalendarMonth")
Set Ctl =
Application.Commandbars("CourseCalendarMonth").Con trols("CalendarMonth") Is this considered late binding? If not, what needs changed?

Thanks!

Steve



Nov 13 '05 #4

P: n/a
So what happens if you remove your reference to the Microsoft Office 10
Library?

"Steve" <no****@nospam.spam> wrote in message
news:Xh*****************@newsread2.news.atl.earthl ink.net...
<< I thought that you needed the Office Objects Library to access
CommandBar items programmatically >>
You do if you use:
Dim Cbr As CommandBar
Dim Ctl As Commandbar.Control
I have Office97, 2000 and XP installed and only have Microsoft Office10
Library in my references. Apparently when later versions of Office are
installed, they remove previous versions of the Microsoft Office Library.
I'm creating an Access97 application that needs to manipulate a commandbar
and the controls on the commandbar. That's the reason for all my questions. The end user of this application will only have MS Office97 installed and
thus Microsoft Office 8 Library in his references. Since I don't have that
reference, I went to late binding with:
Dim Cbr As Object
Dim Ctl As Object

<<it would still be my guess that this reference (Microsoft Office10
Library) would not port well to an earlier version of Access.>>
I think you are very right about this! Upon closer examination, the path to Microsoft Office10 Library on my computer is:
C:\Program Files\Common Files\Microsoft Shared\Office 10\mso.dll
I presume that the path to references is carried with the database for all
checked references. Therefore, I must assume that the other machine would
never be able to find the Microsoft Office10 Library (mso.dll) because it is an Office 8 machine and would not even have an Office 10 folder.

Steve

"MacDermott" <ma********@nospam.com> wrote in message
news:0U*****************@newsread2.news.atl.earthl ink.net...
I stand corrected.

In some earlier threads, I'd said you needed to use CreateObject in this
case.
For some reason, I thought that you needed the Office Objects Library to
access CommandBar items programmatically. I just tried that out and
realized I was wrong on that.

I've lost track of who the OP was on this -
the issue seemed to be running this code on machines using different
versions of Access.
There was a reference to a specific version of the Office Objects
Library; it would still be my guess that this reference would not port

well
to an earlier version of Access.
If this reference is not needed for other reasons, it should be

removed.
If it's needed somewhere else, that place is probably where we need to
look for the problem.

- Turtle

"Douglas J. Steele" <NOSPAM_djsteele@NOSPAM_canada.com> wrote in message
news:zM********************@rogers.com...
Yes, that's late binding.

--
Doug Steele, Microsoft Access MVP
http://I.Am/DougSteele
(no e-mails, please!)

"PC Datasheet" <no****@nospam.spam> wrote in message
news:1d*****************@newsread2.news.atl.earthl ink.net...
>I have this:
> Dim Cbr As Object
> Dim Ctl As Object
> Set Cbr = Application.Commandbars("CourseCalendarMonth")
> Set Ctl =
>

Application.Commandbars("CourseCalendarMonth").Con trols("CalendarMonth") > Is this considered late binding? If not, what needs changed?
>
> Thanks!
>
> Steve
>
>



Nov 13 '05 #5

P: n/a
I have removed the reference and am using late binding as:
Dim Cbr As Object
Dim Ctl As Object
Set Cbr = Application.Commandbars("CourseCalendarMonth")
Set Ctl =
Application.Commandbars("CourseCalendarMonth").Con trols("CalendarMonth")
and all works well.

Steve

"MacDermott" <ma********@nospam.com> wrote in message
news:vc*****************@newsread2.news.atl.earthl ink.net...
So what happens if you remove your reference to the Microsoft Office 10
Library?

"Steve" <no****@nospam.spam> wrote in message
news:Xh*****************@newsread2.news.atl.earthl ink.net...
<< I thought that you needed the Office Objects Library to access
CommandBar items programmatically >>
You do if you use:
Dim Cbr As CommandBar
Dim Ctl As Commandbar.Control
I have Office97, 2000 and XP installed and only have Microsoft Office10
Library in my references. Apparently when later versions of Office are
installed, they remove previous versions of the Microsoft Office Library.
I'm creating an Access97 application that needs to manipulate a commandbar and the controls on the commandbar. That's the reason for all my questions.
The end user of this application will only have MS Office97 installed and thus Microsoft Office 8 Library in his references. Since I don't have that reference, I went to late binding with:
Dim Cbr As Object
Dim Ctl As Object

<<it would still be my guess that this reference (Microsoft Office10
Library) would not port well to an earlier version of Access.>>
I think you are very right about this! Upon closer examination, the path

to
Microsoft Office10 Library on my computer is:
C:\Program Files\Common Files\Microsoft Shared\Office 10\mso.dll
I presume that the path to references is carried with the database for all checked references. Therefore, I must assume that the other machine would never be able to find the Microsoft Office10 Library (mso.dll) because

it is
an Office 8 machine and would not even have an Office 10 folder.

Steve

"MacDermott" <ma********@nospam.com> wrote in message
news:0U*****************@newsread2.news.atl.earthl ink.net...
I stand corrected.

In some earlier threads, I'd said you needed to use CreateObject in this case.
For some reason, I thought that you needed the Office Objects Library to access CommandBar items programmatically. I just tried that out and
realized I was wrong on that.

I've lost track of who the OP was on this -
the issue seemed to be running this code on machines using different versions of Access.
There was a reference to a specific version of the Office Objects
Library; it would still be my guess that this reference would not port well
to an earlier version of Access.
If this reference is not needed for other reasons, it should be

removed.
If it's needed somewhere else, that place is probably where we need to look for the problem.

- Turtle

"Douglas J. Steele" <NOSPAM_djsteele@NOSPAM_canada.com> wrote in

message news:zM********************@rogers.com...
> Yes, that's late binding.
>
> --
> Doug Steele, Microsoft Access MVP
> http://I.Am/DougSteele
> (no e-mails, please!)
>
>
>
> "PC Datasheet" <no****@nospam.spam> wrote in message
> news:1d*****************@newsread2.news.atl.earthl ink.net...
> >I have this:
> > Dim Cbr As Object
> > Dim Ctl As Object
> > Set Cbr = Application.Commandbars("CourseCalendarMonth")
> > Set Ctl =
> >

Application.Commandbars("CourseCalendarMonth").Con trols("CalendarMonth")
> > Is this considered late binding? If not, what needs changed?
> >
> > Thanks!
> >
> > Steve
> >
> >
>
>



Nov 13 '05 #6

P: n/a
Even on other versions of Access?

"Steve" <no****@nospam.spam> wrote in message
news:Mv**************@newsread3.news.atl.earthlink .net...
I have removed the reference and am using late binding as:
Dim Cbr As Object
Dim Ctl As Object
Set Cbr = Application.Commandbars("CourseCalendarMonth")
Set Ctl =
Application.Commandbars("CourseCalendarMonth").Con trols("CalendarMonth")
and all works well.

Steve

"MacDermott" <ma********@nospam.com> wrote in message
news:vc*****************@newsread2.news.atl.earthl ink.net...
So what happens if you remove your reference to the Microsoft Office 10
Library?

"Steve" <no****@nospam.spam> wrote in message
news:Xh*****************@newsread2.news.atl.earthl ink.net...
<< I thought that you needed the Office Objects Library to access
CommandBar items programmatically >>
You do if you use:
Dim Cbr As CommandBar
Dim Ctl As Commandbar.Control
I have Office97, 2000 and XP installed and only have Microsoft Office10 Library in my references. Apparently when later versions of Office are
installed, they remove previous versions of the Microsoft Office Library. I'm creating an Access97 application that needs to manipulate a commandbar and the controls on the commandbar. That's the reason for all my questions.
The end user of this application will only have MS Office97 installed and thus Microsoft Office 8 Library in his references. Since I don't have that reference, I went to late binding with:
Dim Cbr As Object
Dim Ctl As Object

<<it would still be my guess that this reference (Microsoft Office10
Library) would not port well to an earlier version of Access.>>
I think you are very right about this! Upon closer examination, the path
to
Microsoft Office10 Library on my computer is:
C:\Program Files\Common Files\Microsoft Shared\Office 10\mso.dll
I presume that the path to references is carried with the database for all checked references. Therefore, I must assume that the other machine would never be able to find the Microsoft Office10 Library (mso.dll) because it
is
an Office 8 machine and would not even have an Office 10 folder.

Steve

"MacDermott" <ma********@nospam.com> wrote in message
news:0U*****************@newsread2.news.atl.earthl ink.net...
> I stand corrected.
>
> In some earlier threads, I'd said you needed to use CreateObject in

this > case.
> For some reason, I thought that you needed the Office Objects
Library to > access CommandBar items programmatically. I just tried that out and
> realized I was wrong on that.
>
> I've lost track of who the OP was on this -
> the issue seemed to be running this code on machines using different > versions of Access.
> There was a reference to a specific version of the Office
Objects > Library; it would still be my guess that this reference would not port well
> to an earlier version of Access.
> If this reference is not needed for other reasons, it should be
removed.
> If it's needed somewhere else, that place is probably where we

need
to
> look for the problem.
>
> - Turtle
>
> "Douglas J. Steele" <NOSPAM_djsteele@NOSPAM_canada.com> wrote in

message > news:zM********************@rogers.com...
> > Yes, that's late binding.
> >
> > --
> > Doug Steele, Microsoft Access MVP
> > http://I.Am/DougSteele
> > (no e-mails, please!)
> >
> >
> >
> > "PC Datasheet" <no****@nospam.spam> wrote in message
> > news:1d*****************@newsread2.news.atl.earthl ink.net...
> > >I have this:
> > > Dim Cbr As Object
> > > Dim Ctl As Object
> > > Set Cbr = Application.Commandbars("CourseCalendarMonth")
> > > Set Ctl =
> > >
Application.Commandbars("CourseCalendarMonth").Con trols("CalendarMonth") > > > Is this considered late binding? If not, what needs changed?
> > >
> > > Thanks!
> > >
> > > Steve
> > >
> > >
> >
> >
>
>



Nov 13 '05 #7

P: n/a
It works in my Access97 database and I have since tried it in Access2000, XP
as 2000 and XP as 2002 and it also worked in all of them.

Steve

"MacDermott" <ma********@nospam.com> wrote in message
news:2K*****************@newsread2.news.atl.earthl ink.net...
Even on other versions of Access?

"Steve" <no****@nospam.spam> wrote in message
news:Mv**************@newsread3.news.atl.earthlink .net...
I have removed the reference and am using late binding as:
Dim Cbr As Object
Dim Ctl As Object
Set Cbr = Application.Commandbars("CourseCalendarMonth")
Set Ctl =
Application.Commandbars("CourseCalendarMonth").Con trols("CalendarMonth")
and all works well.

Steve

"MacDermott" <ma********@nospam.com> wrote in message
news:vc*****************@newsread2.news.atl.earthl ink.net...
So what happens if you remove your reference to the Microsoft Office 10 Library?

"Steve" <no****@nospam.spam> wrote in message
news:Xh*****************@newsread2.news.atl.earthl ink.net...
> << I thought that you needed the Office Objects Library to access
> CommandBar items programmatically >>
> You do if you use:
> Dim Cbr As CommandBar
> Dim Ctl As Commandbar.Control
> I have Office97, 2000 and XP installed and only have Microsoft Office10 > Library in my references. Apparently when later versions of Office are > installed, they remove previous versions of the Microsoft Office

Library.
> I'm creating an Access97 application that needs to manipulate a

commandbar
> and the controls on the commandbar. That's the reason for all my
questions.
> The end user of this application will only have MS Office97 installed
and
> thus Microsoft Office 8 Library in his references. Since I don't
have
that
> reference, I went to late binding with:
> Dim Cbr As Object
> Dim Ctl As Object
>
> <<it would still be my guess that this reference (Microsoft Office10
> Library) would not port well to an earlier version of Access.>>
> I think you are very right about this! Upon closer examination, the path to
> Microsoft Office10 Library on my computer is:
> C:\Program Files\Common Files\Microsoft Shared\Office 10\mso.dll
> I presume that the path to references is carried with the database
for all
> checked references. Therefore, I must assume that the other machine

would
> never be able to find the Microsoft Office10 Library (mso.dll)
because it
is
> an Office 8 machine and would not even have an Office 10 folder.
>
> Steve
>
> "MacDermott" <ma********@nospam.com> wrote in message
> news:0U*****************@newsread2.news.atl.earthl ink.net...
> > I stand corrected.
> >
> > In some earlier threads, I'd said you needed to use CreateObject
in this
> > case.
> > For some reason, I thought that you needed the Office Objects

Library
to
> > access CommandBar items programmatically. I just tried that out

and > > realized I was wrong on that.
> >
> > I've lost track of who the OP was on this -
> > the issue seemed to be running this code on machines using

different
> > versions of Access.
> > There was a reference to a specific version of the Office

Objects > > Library; it would still be my guess that this reference would not port > well
> > to an earlier version of Access.
> > If this reference is not needed for other reasons, it should be > removed.
> > If it's needed somewhere else, that place is probably where we

need
to
> > look for the problem.
> >
> > - Turtle
> >
> > "Douglas J. Steele" <NOSPAM_djsteele@NOSPAM_canada.com> wrote in

message
> > news:zM********************@rogers.com...
> > > Yes, that's late binding.
> > >
> > > --
> > > Doug Steele, Microsoft Access MVP
> > > http://I.Am/DougSteele
> > > (no e-mails, please!)
> > >
> > >
> > >
> > > "PC Datasheet" <no****@nospam.spam> wrote in message
> > > news:1d*****************@newsread2.news.atl.earthl ink.net...
> > > >I have this:
> > > > Dim Cbr As Object
> > > > Dim Ctl As Object
> > > > Set Cbr = Application.Commandbars("CourseCalendarMonth")
> > > > Set Ctl =
> > > >
> Application.Commandbars("CourseCalendarMonth").Con trols("CalendarMonth") > > > > Is this considered late binding? If not, what needs changed?
> > > >
> > > > Thanks!
> > > >
> > > > Steve
> > > >
> > > >
> > >
> > >
> >
> >
>
>



Nov 13 '05 #8

This discussion thread is closed

Replies have been disabled for this discussion.