PDA

View Full Version : Error writing to Excel with ASP


bostjank
09-02-2002, 08:16 PM
Hello!

I'm using this script to create an Excel file with ASP:

<%
Set ExcelApp = CreateObject("Excel.Application")
ExcelApp.Application.Visible = false
Set ExcelBook = ExcelApp.Workbooks.Add

ExcelBook.Worksheets(1).Cells(1, 1).Value="abc"
ExcelBook.Worksheets(1).Cells(1, 2).Value="cba"

ExcelBook.SaveAs "file.xls"
Set ExcelApp = Nothing
%>



There are a couple of problems:

-When I use this script on my computer (WinMe, Personal Web Server) I get notification if the file I'm trying to write to already exists. On a NT server, there is no such message, but the computer hangs up. How can I write to a file if it already exists?

-The file that I'm writing to is created on a intranet server - how can I save the file to make it possible for an intranet user to access it (for mail merge)?



Thanks very much,
Bostjan