I need a bit of help with understanding/using the MS spreadsheet control in VB6. I have, as a test, a form with a spreadsheet control and a command button on it. I have set a reference to XL. I was expecting that the control would not be greyed out and that it would be rather simple use. So far not. Here's the code I'm trialling if someone has a few minutes to spare. Thanks. Dave
[VBA]
Private Sub Command1_Click()
Dim ObjExcel As Object, ObjWorksheet As Object
Set ObjExcel = CreateObject("EXCEL.APPLICATION")
Set ObjWorksheet = Form1.Sheet1
'the line of code below crashes
ObjWorksheet.Cells(1, 1).Value = InputBox("Test No.")
'the line below doesn't seem to do anything?
Form1.Sheet1.Visible = True
ObjExcel.Quit
Set ObjWorksheet = Nothing
Set ObjExcel = Nothing
End Sub
[/VBA]