|
Hi all,
I have write the following coding and save it as file name "/forum/test3.html", in order to generate a excel file. After I have run the ASP file in IE, although I can save the file "/forum/de.xls" in the directory, it prompts me out another file download messagebox, asking me whether I want to open or save another excel file named "/forum/test3.xls". I have tried to save the "/forum/test3.xls" file into local and open it, but it prompts me error "Unable to read file" and there is nothing inside "/forum/test3.xls"
Since I would only need the "/forum/de.xls" file, is there any method, besides using FileSystemObject (i.e. without re-writing the codes), to generate an excel file but without prompting me confirmation message box? Thanks for help.
Tony
<%@LANGUAGE="VBScript"%>
<% Response.ContentType = "application/vnd.ms-excel" %>
<%
Dim objExcelApp
Set objExcelApp = CreateObject("Excel.Application")
Set objExcelBook = objExcelApp.workbooks.add
Set objExcelSheets = objExcelBook.Worksheets
Set objExcelSheet = objExcelBook.Sheets(1)
objExcelSheet.Activate
objExcelApp.Application.Visible = True
objExcelSheet.Cells(1,1).Value = "mum"
objExcelSheet.Cells(1,2).Value = "dad"
objExcelApp.activeworkbook.SaveAs("/forum/CInetPubwwwroottempde.xls")
objExcelApp.Application.Quit
Set objExcelApp = Nothing
%>
|
|
|
|
|
|
|
|