VBからExcelを操作する

Dim excel As Object
Set excel = CreateObject("Excel.Application")

excel.Application.Visible = True
excel.Application.UserControl = False

excel.Workbooks.Open "C:\test.xls"

Dim i As Integer
For i = 1 To excel.Sheets.Count

    excel.Sheets(i).Cells(1, 1).Value = "Test"

Next i

'excel.Run "Macro"

excel.ActiveWorkBook.Close False
excel.Quit

Set excel = Nothing