Dim Public objXLRoot as [_ExcelApplication]
Dim Public objXLApp as Excel.Application
'För att initialisera objXLRoot, använd denna metod:
Set objXLRoot = New [_ExcelApplication]
' Denna rutin illustrerar denna tekniken:
Private Sub Command2_Click()
Dim objXL As Excel.Application
Dim objXLRoot As [_ExcelApplication]
Dim objWKB As Excel.Workbook
Set objXLRoot = New [_ExcelApplication]
Set objXL = objXLRoot.Application
objXL.Visible = True
Set objWKB = objXL.Workbooks.Add
objWKB.Worksheets(1).Range("A2").Formula = "Hejsan"
objWKB.Parent.ActiveCell.Formula = "Varför?"
End Sub