View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Bob Phillips[_5_] Bob Phillips[_5_] is offline
external usenet poster
 
Posts: 620
Default Excel Questions for VB6

Aaron,

Big question. Essentially, it is the same as you would do from VBA. Create
an in stance of Excel, and then navigate through the Excel object model

Dim xlApp As Object
Dim xlWorkbook As Object
Dim xlSheet As Object

Set xlApp = CreateObject("Excel.Application")
xlApp.Visible = True
Set xlWorkbook = xlApp.Workbooks.Open("C:\myTest\myFile.xls")
Set xlSheet = xlWorkbook.Worksheets(1)
MsgBox xlSheet.Range("A1")

xlApp.Quit

Set xlApp = Nothing



--

HTH

Bob Phillips

"Aaron" <NONE wrote in message ...
How can you connect to an Excel spread sheet via VB6 (not VBA) to retrieve
information from specfic cells?

Thanks,
Aaron