I have Office 2003 and Office 2007 installed on my machine.
I am trying to develop a solution for a customer that just uses Office 2003.
From Word I need to get information from Excel. So in my macro I have
Dim xlApp As Excel.Application
Dim xlWB As Excel.Workbook
etc, etc
I have tried to add a reference to Microsoft Excel, but could only find a
reference to Microsoft Excel 12.0, which I presume is Office 2007.
Is there anyway I can add a reference to Excel 2003 into my code, so that it
works on my customer's machine (who only had 2003)?
Thanks for your help
Graham Mayor - 02 Jul 2007 13:19 GMT
It should work if you set it locally up with the Excel 12.0 library and at
your customer's location with the Excel 11.0 library. The command set will
be largely similar.

Signature
<>>< ><<> ><<> <>>< ><<> <>>< <>><<>
Graham Mayor - Word MVP
My web site www.gmayor.com
Word MVP web site http://word.mvps.org
<>>< ><<> ><<> <>>< ><<> <>>< <>><<>
> I have Office 2003 and Office 2007 installed on my machine.
>
[quoted text clipped - 15 lines]
>
> Thanks for your help
Helmut Weber - 02 Jul 2007 15:51 GMT
Hi Carl,
just another one:
often early binding for development is recommended,
and later on late binding for execution,
which should work with some versions of Excel, in theory.
Sub Test459b()
' early binding with reference to Excel library
'Dim oExls As Excel.Application
'Dim oWrks As Excel.Worksheet
' late binding without reference to Excel library
Dim oExls As Object
Dim oWrks As Object
On Error Resume Next
Set oExls = GetObject(, "Excel.Application")
Err.Clear
If oExls Is Nothing Then
Set oExls = CreateObject("Excel.application")
End If
oExls.Visible = True
Set oWrks = oExls.Workbooks.Add ' or open a workbook
End Sub

Signature
Greetings from Bavaria, Germany
Helmut Weber, MVP WordVBA
Win XP, Office 2003
"red.sys" & Chr$(64) & "t-online.de"