So leaving out the last 2 optional options did that too ... [Eek!] [Roll Eyes] [Mad]

Big thanks Shawn (again!)

here's my approach which works too :


break on

$file = @scriptdir + '\test.xls'
if exist($file)
del $file
endif

$xl = createobject ( "excel.application" )
$ = $xl.workbooks.add

for $i = 1 to 7
if $i > 3
$_ = $xl.worksheets.add(,$xl.ActiveSheet)
endif
$_ = $xl.WorkSheets("Sheet"+$i).Activate
$xl.ActiveSheet.name = "A" + $i
$xl.range("C3").value = "writetosheet$i"
next

$ = $xl.ActiveWorkbook.SaveAs($file)
$xl.UserControl = 1
$ = $xl.quit
_________________________