Developing for multiple Office installations

L

Lowell

I am developing a VB application (Visual Studio 6 not VBA) and I would like
to support multiple versions of Office (9,10,11). Should I include a
reference to the various OLB's? Should I install multiple versions of Office
or just grab the OLB's from those installations (I have them on various test
machines. I assume you cannot install multiple versions of Office on a single
PC).

With respect to the reference question, should I declare the object variable
for word using "Word.application" or just "Object?"

I have successfull gotten Excel automation to work across multiple versions
of Excel using "Object" as opposed to "Excel.Application" but not so much
success with Word. I get nasty "DLL did not initialize" and "server failed"
type errors.
 
E

Evan Stone

Lowell:

This KB article may be of some help to you:

INFO: Writing Automation Clients for Multiple Office Versions
http://support.microsoft.com/default.aspx?scid=kb;en-us;244167

....in which it states:

"Reference the type library of the earliest version of the Office
application you intend to Automate"

So my next question is, where can I get my hands on the MSWORD.OLB for Word
version 9?

evan stone | software engineer
 
J

Jonathan West

Evan Stone said:
Lowell:

This KB article may be of some help to you:

INFO: Writing Automation Clients for Multiple Office Versions
http://support.microsoft.com/default.aspx?scid=kb;en-us;244167

...in which it states:

"Reference the type library of the earliest version of the Office
application you intend to Automate"

So my next question is, where can I get my hands on the MSWORD.OLB for
Word
version 9?

By installing a copy of Office 2000. The OLB will not work except in
association with the full version of Word 2000.

By the way, do this on a separate machine (either a separate physical
machine or a separate virtual machine under VirtualPC). Don't attempt to
install multiple copies of Office on the same operating system. It can be
made to work, but it is not a stable development platform nor a realistic
environment for customer machines.


--
Regards
Jonathan West - Word MVP
www.intelligentdocuments.co.uk
Please reply to the newsgroup
Keep your VBA code safe, sign the ClassicVB petition www.classicvb.org
 
L

Lowell

Thanks for your suggestions. After much reserach, it seems the best way to
supoort multiple versions of Excel/Word is to use OUT of process calls. This
is somewhat counter intuitive. I did manage to find an article which stated
that Microsoft has optimized Excel for out of process automation. It seems
to work just fine. If I can find the link I will post again later.

One note: I had setup the CreateObject() call in the init of my class. Excel
does not seem to like this. I got "server thew an exception until I put all
the calls to EXCEL objects in the same routine. Also, beware that if you have
a bug in the file that you're trying to open which causes Excel to crash, you
will get odd "file not found" messages which will mislead you and make you
very unhappy.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top