Class Createexcel
Private Createtype_
Private Savepath_
Private Readpath_
Private Authorstr REM Set author
Private VERSIONSTR REM Set version
Private SYSTEMSTR REM Set system name
Private sheetname_ rem Set table name
Private Sheettitle_ REM Set title
Private exceldata REM Set table data
Private Excelapp REM Excel.Application
Private Excelbook
Private Excelsheets
Private usedtime_ REM Use time
Public Titlefirstline REM First line title
Private Sub Class_Initialize ()
Server.ScriptTimeout = 99999
Usedtime_ = Timer
Systemstr = "Lc00_createexcelserver"
Authorstr = "Surnfu surnfu@126.com 31333716"
VERSIONSTR = "1.0"
If not isobjinstalled ("Excel.Application") Then
Inerr (Excel.Application control is not installed on the server)
End If
Set excelapp = CreateObject ("Excel.Application")
Excelapp.displayalerts = False
Excelapp.application.visible = False
Createtype_ = 1
Readpath_ = null
End Sub
Private Sub Class_Terminate ()
excelapp.quit
if IsObject (excelsheets) then Set excelsheets = Nothing
if IsObject (Excelbook) then set excelbook = Nothing
if IsObject (excelapp) Then Set excelapp = Nothing
End Sub
Public Property Let Readpath (ByVal val)
If InStr ( Val, ":") <>0 then
readpath_ = Trim (val)
Else
Readpath_=server.mappath (Trim (val))
End If
End Property
Public Property Let Savepath (ByVal val)
If InStr (Val, ":") <>0 Then
Savepath_ = Trim (val)
Else
Savepath_=server.mappath (Trim (val))
End If
End Property