ASP reads Excel code (four different instances of Excel application) (1/5)

Source: Internet
Author: User
Tags trim

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

Home 1 2 3 4 5 last
Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.