View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Doug Robbins - Word MVP on news.microsoft.com Doug Robbins - Word MVP on news.microsoft.com is offline
external usenet poster
 
Posts: 10
Default how to access data from excel to/from another program using Vb

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