<%
Private Sub MkSheet(byVal pathname)
Dim objXls, objBook, objFSO
Set objFSO = Server.CreateObject("Scripting.FileSystemObject")
if objFSO.FileExists( pathname ) then
Set objFSO = Nothing
Err.Raise 5150, "MkSheet Statement", _
"File Already Exists! MkSheet " & _
"can only create sheets."
Exit Sub
end if
Set objFSO = Nothing
On Error Resume Next
Set objXls = CreateObject("Excel.Application")
If Err Then
Err.Clear
On Error GoTo 0
Err.Raise 5150, "MkSheet Statement", _
"Microsoft Excel Is Not Installed " & _
"On This Server!"
Exit Sub
End If
set objBook = objXls.Workbooks.Add
objBook.SaveAs( pathname )
set objBook = Nothing
objXls.Quit
Set objXls = Nothing
On Error GoTo 0
End Sub
%>