Welcome to the Forums.

What version of Excel are you using? Do you need to support different versions of Excel?

This will work.

VB Code:
  1. Option Explicit
  2.  
  3. Private Sub Command1_Click()
  4.     Dim oApp As Object
  5.     Dim oWB As Object
  6.     Dim oSht As Object
  7.     Set oApp = CreateObject("Excel.Application")
  8.     oApp.Visible = True
  9.     Set oWB = oApp.Workbooks.Add
  10.     Set oSht = oWB.Sheets("Sheet1")
  11.     oSht.Cells(1, 1).Value = "This is column A, row 1"
  12.     oWB.Close SaveChanges:=True, FileName:="C:\Book1.xls"
  13.     Set oSht = Nothing
  14.     Set oWB = Nothing
  15.     oApp.Quit
  16.     Set oApp = Nothing
  17. End Sub
Moved from Classic VB forum.