Link to home
Create AccountLog in
Microsoft Office

Microsoft Office

--

Questions

--

Followers

Top Experts

Avatar of LittlePerson
LittlePerson

Excel 9 and excel 10 .OLB
Hello Experts

How can you make an excel add-in that can work on both Office 2000 and Office XP?
I have one that I developed in Office 2000, but how can I get it to work in Office XP, does it
to know what library file to references or do you distribute excel9.olb and the add-in just
uses that even though Office XP uses excel.olb.


LittlePerson

Zero AI Policy

We believe in human intelligence. Our moderation policy strictly prohibits the use of LLM content in our Q&A threads.


ASKER CERTIFIED SOLUTION
Avatar of Brian MulderBrian Mulder🇳🇱

Link to home
membership
Log in or create a free account to see answer.
Signing up is free and takes 30 seconds. No credit card required.
Create Account

Avatar of LittlePersonLittlePerson

ASKER

Thanks

I see what you mean.

I just installed Office XP and ran the app and it worked. Apart from the custom toolbars
I have are displayed in the wrong order. Not a big problem and the rest seems to work
OK apart from an annoying little "Type a question for help" combobox which has appeared
on the right hand side of my custom menu - Can you switch this off?

Thanks for the link I think I will have to look into late binding a little more.


One thing though - how if the app has a reference to excel9.olb can it work!
I searched my hard drive to be sure and no excel9.olb.

Thanks again
LittlePerson

Forgot to mention that I am using early binding on all excel objects except the WorkSheets
object as that doesn't seem to work unless you declare it as an object.

Avatar of Brian MulderBrian Mulder🇳🇱

early binding is with inclusion of the dll in the references and uses declarations like

dim xl as excel.application

late binding is without a reference to any dll and uses declarations like

dim xl as object

or

dim xl

leaving it to the application to find the object to use

you cannot use dim worksheets as object because worksheets is a reserved word within the excel application you can do something like

dim wsh as worksheets
dim ws as worksheet

for each ws in wsh
  'do your thing
next

Reward 1Reward 2Reward 3Reward 4Reward 5Reward 6

EARN REWARDS FOR ASKING, ANSWERING, AND MORE.

Earn free swag for participating on the platform.


Hi again

I appreciate that and that is what I was trying to say. I am using early binding so I
have a reference to the type library for excel9.olb

The only object I declare is for the worksheets object, i.e.

Dim xlWkShts As Object

As it the add-ins don't seem to like declaring it as excel.Worksheets

eveything else is early binding

Dim xlWkSht As Excel.Worksheet


So my question then was given that excel9.olb is no where to be found on the machine. The app
still runs on Office XP. I was just a little puzzled as to how this could work. Maybe I am not
understanding.

Thanks for the reply
LittlePerson


Avatar of Brian MulderBrian Mulder🇳🇱

2 things can't find it right now

- suspecting that the excel xp is backwards compatible with the excel9.olb that would make sense since there is only functionality added in a version upward
- i would always use late binding it is bit slower but you got no worry about which version of excel is installed on the client


I look into the backward compatible for Office XP I have and see if that is the case. If you
find the links (I pressume thats what you meant "2 things can't find it right now") I would be
most grateful. I think Late binding could be the way forward though.

Thanks again for the answers.

Kind Regards
LittlePerson

Free T-shirt

Get a FREE t-shirt when you ask your first question.

We believe in human intelligence. Our moderation policy strictly prohibits the use of LLM content in our Q&A threads.

Microsoft Office

Microsoft Office

--

Questions

--

Followers

Top Experts

Microsoft Office is an integrated suite of applications that includes Outlook, Word, Excel, Access, PowerPoint, Visio and InfoPath, along with a number of tools to assist in making the individual components work together. Coding within and between the projects is done in Visual Basic for Applications, known as VBA.