Microsoft Excel 11.0 reference missing

C

CarlSprake

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
 
G

Graham Mayor

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.

--
<>>< ><<> ><<> <>>< ><<> <>>< <>><<>
Graham Mayor - Word MVP


<>>< ><<> ><<> <>>< ><<> <>>< <>><<>
 
H

Helmut Weber

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

--
Greetings from Bavaria, Germany

Helmut Weber, MVP WordVBA

Win XP, Office 2003
"red.sys" & Chr$(64) & "t-online.de"
 

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