How to save Excel type of file

When I create a file with the extension .xls, it is created well. But, every time Excel shows a warning message like
‘The file format and extension of ‘excelOut_temp.xls’ don’t match. …’

I think the generated file itself has a text file type instead of Excel.
Is there any way to avoid that kind of warning message? I mean the way I can save the file with Excel type.

Dim Documents As FolderItem = SpecialFolder.ApplicationData
ExcelOutputName = "excelOut_temp.xls"
Dim f As FolderItem = Documents.Child(ExcelOutputName)
Dim excelOut As TextOutputStream = TextOutputStream.Create(f)

excelOut.Write Datalist.cell(-1,-1)


With below code instead of ‘f.launch’, I don’t see that message anymore.

    excel.Visible = true