Saving an Excel file

All,

I need to convert a batch of HTML files to Excel (including some reformatting). I can load the HTML file and do the re-formatting. But saving beats me. This is the code I have


tell application "Microsoft Excel"
			activate
			open workbook workbook file name InDatei
			activate object worksheet "Sheet1"
			
			set column width of range "A:G" of active sheet to 4
			set column width of range "H:H" of active sheet to 100
			
			save workbook as workbook filename OutDatei
			close active workbook
			
		end tell

Can anyone help by telling me what I am doing wrong?

Thanks
Niels

Hi Niels,
try this:

set the_path to (path to desktop as string) & "OutDatei"
tell application "Microsoft Excel"
	activate
	open workbook workbook file name InDatei
	activate object worksheet "Sheet1"
	
	set column width of range "A:G" of active sheet to 4
	set column width of range "H:H" of active sheet to 100
	
	save active workbook in the_path
	close active workbook
end tell

Thanks,
Nik

Thanks, Nik. Worked a treat.
Niels