![asp讀取excel代碼(舉了四個(gè)excel不同實(shí)例應(yīng)用)_第1頁(yè)](http://file3.renrendoc.com/fileroot_temp3/2022-1/2/740c3fc6-7376-472b-b555-6e238615111b/740c3fc6-7376-472b-b555-6e238615111b1.gif)
![asp讀取excel代碼(舉了四個(gè)excel不同實(shí)例應(yīng)用)_第2頁(yè)](http://file3.renrendoc.com/fileroot_temp3/2022-1/2/740c3fc6-7376-472b-b555-6e238615111b/740c3fc6-7376-472b-b555-6e238615111b2.gif)
![asp讀取excel代碼(舉了四個(gè)excel不同實(shí)例應(yīng)用)_第3頁(yè)](http://file3.renrendoc.com/fileroot_temp3/2022-1/2/740c3fc6-7376-472b-b555-6e238615111b/740c3fc6-7376-472b-b555-6e238615111b3.gif)
![asp讀取excel代碼(舉了四個(gè)excel不同實(shí)例應(yīng)用)_第4頁(yè)](http://file3.renrendoc.com/fileroot_temp3/2022-1/2/740c3fc6-7376-472b-b555-6e238615111b/740c3fc6-7376-472b-b555-6e238615111b4.gif)
![asp讀取excel代碼(舉了四個(gè)excel不同實(shí)例應(yīng)用)_第5頁(yè)](http://file3.renrendoc.com/fileroot_temp3/2022-1/2/740c3fc6-7376-472b-b555-6e238615111b/740c3fc6-7376-472b-b555-6e238615111b5.gif)
版權(quán)說(shuō)明:本文檔由用戶(hù)提供并上傳,收益歸屬內(nèi)容提供方,若內(nèi)容存在侵權(quán),請(qǐng)進(jìn)行舉報(bào)或認(rèn)領(lǐng)
文檔簡(jiǎn)介
1、asp讀取excel代碼(舉了四個(gè) excel不同實(shí)例應(yīng)用)asp? a e ?excel ' ? ?(? u a ?excel2? i ?e a y o | o ?).txt37?3? e ?a?£?e - Y? ?,?. & 0 £ ?3?e ?e£?u ?' |? a - ?2? o u ?a a ?£ ?3? e ? e ? , £ ? i ? o u e ?e ?o D)o a ?£public property let createtype(byval val)if val <> 1 a
2、nd val <> 2 thencreatetype_ = 1 elsecreatetype_ = val end ifend propertypublic property let data(byval val)if not isarray(val) theninerr("± i e y?Ye 6 ?6 D?6 ')end ifexceldata = valend propertypublic property get savepath()savepath = savepath_end propertypublic property get usedt
3、ime()usedtime = usedtime_ end property publicpropertyletsheetname(byval val) if not isarray(val) then if val = "" theninerr("± i ?6 6 ?6 D?6end if titlefirstline = trueelse redim titlefirstline(ubound(val) dim ik_forik_ =0 to ubound(val)titlefirstline(ik_)=truenextend if sheetnam
4、e = valend propertypublicpropertyletsheettitle(byval val)if not isarray(val) then if val = "" thennerr(" ± i ± e i a6 6 ?6 D?6 ") end ifend if sheettitle_ = valend propertyrem ? i 2e e y?Yprivate sub checkdata()ifsavepath_ ="" thennerr("± £ '
5、; ??2? u ?a?")ifnot isarray(sheetname_)thenifsheetname_ = "" theninerr(" ± i ?2?u ?a?")end ifif createtype_ = 2 thenif not isarray(exceldata)thenend ifinerr(nEyYO0Ee' ii6£-i»dOBI' O0Ee n)end ifexit sub end ifif isarray(sheetname_) then if not isarray (
6、sheettitle_) thenif sheettitle_ <> theninerr (n±i±eiaEedAODi6£-i6e±iAu2 »500 i")end ifend ifif not isarray (exceldata) then inerr(H±iEyYd0EeODi6n)if isarray(sheetname_) then if getarraydim(exceldata)<>1thennerr(" ± i e y?Y?6 ?6 D?6 £ ?e y
7、?Y?e ?' i ? o ? ?e o |?a o ?") elseif getarraydim(exceldata)<>2thennerr(" ± i e y?Y?e ?6 D?6 £ ?e y?Y?e ?' i ? o ? ?e o |?a?t") end if end sub rem e u 3e excel public function create() call checkdata() if not isnull(readpath_) thenexcelapp.workbooks.open(readpa
8、th_) elseexcelapp.workbooks.addend ifsetexcelbookexcelapp.activeworkbook setexcelsheetsexcelbook.worksheetsif createtype_ = 2 then dim ih_forih_ =0 toubound(exceldata) call setsheets(exceldata(ih_), ih_)nextexcelbook.saveas savepath_ usedtime_ formatnumber(timer usedtime_)*1000, 3) exit function end
9、 ifif isarray(sheetname_) thendim ikforubound(exceldata)iktocall createsheets(exceldata(ik_), ik_) next else call createsheets(exceldata, -1) end ifexcelbook.saveas savepath_usedtime_=formatnumber(timer-usedtime_)*1000, 3) end function private sub createsheets(byval data_, dataid_)dim spreadsheetdim
10、 tempsheettitledim temptitlefirstlineif dataid_<>-1 then ifdataid_>excelsheets.count - 1 thenexcelsheets.add()setspreadsheetexcelbook.sheets(l)elsesetspreadsheetexcelbook.sheets(dataid_ + 1)end ififisarray(sheettitle_)thentempsheettitle sheettitle_(dataid_)else tempsheettitle =""e
11、nd iftemptitlefirstline titlefirstline(dataid_) sheetname_(dataid_) elsesetspreadsheetexcelbook.sheets(l)sheetname_tempsheettitlesheettitle_temptitlefirstlinetitlefirstlineend ifdim line_ : line_ = 1dim rownum_ : rownum_ubound(data_, 1) + 1dim lastcols_if tempsheettit
12、le <> "" thenspreadsheet.columns(1).shrinktofio D?Gi ¥t=truee e ?, e ? ?X?- e e o | ± i ? 以 ¥ ?a ? i 2?±?£?lastcols_getcolname(ubound(data_, 2) + 1)with spreadsheet.cells(1,1).valuetempsheettitle;usijuu6!|e|e;uozuoq"c V 。乙£ 不乙乙q X 66 ? 5 J = X9pUU0|
13、00J0U9;Ur,(Q 9 CiC X d )666 X 71 0 乙乙。 sBjsiju"(J愚-s|oo;se|i.e.JsBuejjssqspesjds!mq;i/v pus6 5 X。?乙乙乙丁 _9 566 CCCJC CCC CXCCCCC 天石乙乙 W 3=X9pUU0|00;U0;|,16 I 6X6666 X 66,Z I6d.=9eu ;uoj-606X6666天寸乙乙Z 03=9ZIS;U0J-+GCCC I 6X6666 X E3S|EJ =例網(wǎng)UOJ6 66 16X666 X 引am; =pioqjuoj"6 I 6X6 6 P I + 190X
14、966 W V.end withline = 2 rownum_ = rownum_ + 1end ifdim irow_, icol_dim drow_, dcol_dimtemplastrange2)+1)&templastrange getcolname(ubound(data_, (rownum_)dim beginrow : beginrow = 1 if tempsheettitle <> "" then beginrow = beginrow + 1if temptitlefirstline = true then beginrow = b
15、eginrow + 1if beginrow=1 then withspreadsheet.range("a1:"& templastrange).borders.linestyle = 1.borderaround-4138 ' e e ? i a? o-4119,.numberformatlocal"" '? ± ? e ?.font.bold = false.font.italic = false.font.size = 10.shrinktofit=trueend withelsewithspreadsheet.
16、range("a1:"&templastrange).borders.linestyle = 1.borderaround-4119,-4138.shrinktofit=trueend with withspreadsheet.range("a"&beginrow&":"& templastrange).numberformatlocal"".font.bold = false.font.italic = false .font.size = 10 end with end ifif
17、 temptitlefirstline = truethenbeginrow = 1iftempsheettitle <> "then beginrow = beginrow + 1withspreadsheet.range("a"&beginrow&":"& getcolname(ubound(data_, 2)+1) & (beginrow) .numberformatlocal"" .font.bold = true .font.italic = false.font.siz
18、e = 12 .interior.colorindex37 .horizontalalignment3 '? o ?D.font.colorindex=2 end withend iffor irow_ = line_ to rownum_foricol_ =1 to(ubound(data_, 2) + 1) dcol_ = icol_ - 1 iftempsheettitle <> ""then drow_ = irow_ - 2 else drow_ = row_ - 1ifnotsnull(data_(drow_, dcol_) thenwith
19、spreadsheet.cells(irow_, icol_) .valuedata_(drow_, dcol_)end withend if next next set spreadsheet = nothing end subrem 2a e ?X e ?t e ? ? o ?- ° 2X°privatefunctionsobjinstalled(strclassstring) on error resume next isobjinstalled = false err = 0 dim xtestobj setxtestobjserver.createobject(s
20、trclassstring )if 0 = err then isobjinstalled =trueset xtestobj = nothing err = 0end functionrem 6 ? ?6 yX 6 ?6 yprivatefunctiongetarraydim(byval arr) getarraydim = null dim i_, temp if isarray(arr) then for i_ = 1 to 60 on error resume next temp = ubound(arr, i_) iferr.number <> 0 thengetarra
21、ydim= i_ - 1err.clear exit functionend ifnextgetarraydim = i_end ifend functionclass createexcelprivate createtype_ private savepath_ private readpath_private authorstr reme e ?X + ?private versionstr reme e ?° ?士?private systemstr reme e ? ti i 3?3?private sheetname_ rem e e ?± i ?private
22、 sheettitle_ reme e ?± e i aprivate exceldata reme e ?± i e y?Yprivate excelapp remexcel.applicationprivate excelbookprivate excelsheetsprivate usedtime_ reme16?ti?e±?public titlefirstline reme X DD6 ? - ?± e i aprivate sub class_initialize() server.scripttimeout = 99999usedtime_ = timer systemstr "lc00_createexcelserver" authorstr 'surnfu surnfu 31333716” versionstr "1.0"ifnotsobjinstalled("excel.application
溫馨提示
- 1. 本站所有資源如無(wú)特殊說(shuō)明,都需要本地電腦安裝OFFICE2007和PDF閱讀器。圖紙軟件為CAD,CAXA,PROE,UG,SolidWorks等.壓縮文件請(qǐng)下載最新的WinRAR軟件解壓。
- 2. 本站的文檔不包含任何第三方提供的附件圖紙等,如果需要附件,請(qǐng)聯(lián)系上傳者。文件的所有權(quán)益歸上傳用戶(hù)所有。
- 3. 本站RAR壓縮包中若帶圖紙,網(wǎng)頁(yè)內(nèi)容里面會(huì)有圖紙預(yù)覽,若沒(méi)有圖紙預(yù)覽就沒(méi)有圖紙。
- 4. 未經(jīng)權(quán)益所有人同意不得將文件中的內(nèi)容挪作商業(yè)或盈利用途。
- 5. 人人文庫(kù)網(wǎng)僅提供信息存儲(chǔ)空間,僅對(duì)用戶(hù)上傳內(nèi)容的表現(xiàn)方式做保護(hù)處理,對(duì)用戶(hù)上傳分享的文檔內(nèi)容本身不做任何修改或編輯,并不能對(duì)任何下載內(nèi)容負(fù)責(zé)。
- 6. 下載文件中如有侵權(quán)或不適當(dāng)內(nèi)容,請(qǐng)與我們聯(lián)系,我們立即糾正。
- 7. 本站不保證下載資源的準(zhǔn)確性、安全性和完整性, 同時(shí)也不承擔(dān)用戶(hù)因使用這些下載資源對(duì)自己和他人造成任何形式的傷害或損失。
最新文檔
- 鰻魚(yú)浮水飼料行業(yè)深度研究報(bào)告
- 環(huán)保組織入團(tuán)申請(qǐng)書(shū)模板
- 幼兒園招生計(jì)劃書(shū)范文
- 住宅小區(qū)給排水管道施工安全措施
- 2025年度大型攪拌工程承包施工合同書(shū)
- 中小水電站工程施工合同
- 2025年度教育設(shè)施建設(shè)項(xiàng)目全過(guò)程造價(jià)咨詢(xún)合同
- 2025年度文化產(chǎn)業(yè)股權(quán)合同轉(zhuǎn)讓協(xié)議
- 2025年度國(guó)際貿(mào)易合同翻譯與全球貿(mào)易術(shù)語(yǔ)標(biāo)準(zhǔn)服務(wù)合同
- 2025年度光伏發(fā)電項(xiàng)目安裝與維護(hù)合同范本
- 地理-廣東省上進(jìn)聯(lián)考領(lǐng)航高中聯(lián)盟2025屆高三下學(xué)期開(kāi)學(xué)考試題和答案
- 2025年熱管換熱氣行業(yè)深度研究分析報(bào)告
- 華為采購(gòu)質(zhì)量?jī)?yōu)先及三化一穩(wěn)定推進(jìn)
- 職業(yè)學(xué)院學(xué)生晚出、晚歸、不歸管理辦法
- 2025年高三歷史高考第二輪復(fù)習(xí)知識(shí)梳理中國(guó)史部分復(fù)習(xí)提綱
- 《安利蛋白質(zhì)粉》課件
- 護(hù)理三基三嚴(yán)習(xí)題+參考答案
- 2025門(mén)診護(hù)理工作計(jì)劃
- 員工互評(píng)表(含指標(biāo))
- 電氣領(lǐng)域知識(shí)培訓(xùn)課件
- 山東省部分學(xué)校2024-2025學(xué)年高一上學(xué)期12月選科指導(dǎo)聯(lián)合測(cè)試地理試題( 含答案)
評(píng)論
0/150
提交評(píng)論