I curious about the excel writing codes from microsoft site (see below - I added the temp folder bit).The code asks for the "saveas" to exist for the code to work. I just want to create an excel file with some data inside it and let the user decide whether to save the file or not. if the file is saved by default I need to delete the file every time the code is run. Could anyone tell me how to write an excel file (from onclick event) and not need to save it?
Set FS = CreateObject("Scripting.FileSystemObject")
Set Excel = CreateObject("Excel.Sheet")
Excel.Application.Visible = True
Excel.Application.Cells(1, 1).Value = "test"
Excel.SaveAs FS.GetSpecialFolder(2) & "\SumExcelOutput.xls"
Set Excel = Nothing