Hi,
I need to:
1. Open existing Excel
2. Modify it (including INSERTING ROWS)
3. Save changes
4. Close Excel
And do all this using code below (CreateObject stuff)
ThanksCode:Dim objExcel As Object Private Sub Command1_Click() Set objExcel = CreateObject("Excel.sheet") objExcel.application.cells(1, 1).Font.Bold = True objExcel.application.cells(1, 1).Value = "Item" objExcel.application.cells(1, 2).Value = "Number" objExcel.application.cells(1, 3).Value = "Description" objExcel.application.cells(1, 4).Value = "Price" objExcel.application.Visible = True ' Save to file objExcel.save "OleTest.xls" ' Quit Excel objExcel.application.quit ' Release object variable Set objExcel = Nothing End Sub




Reply With Quote