Select Tools, Reference and click on tickbox for Microsoft Excel 8.0 of your VB application to use an early binding reference to the Excel Application
Sample code:
Declare a refrence to the Excel application:
Private wks as Excel.Application
'Private wks As Object ' is the alternative for a Late Binding object
To start the excel app either use for early binding:
Set wks = New Excel.Application
'Set wks = CreateObject("Excel.Application")'late binding
'wks.Visible = True ' depends on whether you wish to see it
Opening a specific spreadsheet:
wks.Workbooks.Open Filename:="yourexcel.wks"
Placing a specific value in cell a1 on sheet1:
wks.Workbooks("yourexcel.wks").Worksheets("sheet1").Range("a1").Value = 1
Running a sub called hello in ThisWorkBook with a string parameter
wks.Run "yourexcel.wks!ThisWorkBook.hello", "Hello world"
Save the sheet
wks.Workbooks(SimName).SaveAs Filename:=SaveName