Sub Test()
  Dim XFO As XLSFileObject
  Dim XFile As IXLSFile
  Dim S As ISheet
  
  Set XFO = New XLSFileObject
  Set XFile = XFO.XLSFile
  Set S = XFile.Workbook.Sheets(1)
  
  ' set cell value
  S.Cells(1, 1).Value = Now()
  ' format cell
  S.Cells(1, 1).FillPattern = xlPatternSemiGray75
  S.Cells(1, 1).FillPatternBGColorIndex = xlColorBlueViolet
  
  ' set column width
  S.Columns(1).WidthPx = 100
    
  ' save workbook to the file
  XFile.SaveAs ("c:\vbatest.xls")
End Sub

