To use that code, you will need to set a reference to the Excel Object
Library.
See the article "Control Excel from Word" at:
http://www.word.mvps.org/FAQs/InterD...XLFromWord.htm
and the article "Early vs. Late Binding" at:
http://www.word.mvps.org/FAQs/InterD...ateBinding.htm
--
Hope this helps.
Please reply to the newsgroup unless you wish to avail yourself of my
services on a paid consulting basis.
Doug Robbins - Word MVP, originally posted via msnews.microsoft.com
"Jacob Skaria" wrote in message
...
Dear Abel
Try below code after referencing Microsoft Excel Object Library
If this post helps click Yes
---------------
Jacob Skaria
Dim xlApp As Excel.Application
Dim xlWB1 As Excel.Workbook
Set xlWB1 = xlApp.OpenWorkbook("c:\temp.xls")
'Read values
strTemp = xlWB1.Sheets(1).Range("A1")
xlWB1.Close
Set xlWB1 = Nothing
xlApp.Quit
Set xlApp = Nothing