⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 nb联盟18.htm

📁 较为详细的介绍了asp自定义的各种函数,方便asp的各种开发.
💻 HTM
📖 第 1 页 / 共 2 页
字号:
             Next”将有助于改善这种情况,因为它会不管文件是否产生错误都坚持执行到“Application.Quit”,保证每次程序执行完不留下死进程。 
            &nbsp;<BR>&nbsp;<BR>补充两点: &nbsp;<BR>1、其他Excel具体操作可以通过录制宏来解决。 
            &nbsp;<BR>2、服务器端打开SQL企业管理器也会产生问题。 &nbsp;<BR>&nbsp;<BR>七、例子 
            &nbsp;<BR>&nbsp;<BR>&lt;% &nbsp;<BR>On &nbsp;Error &nbsp;Resume 
            &nbsp;Next &nbsp;<BR>&nbsp;<BR>strAddr &nbsp;= 
            &nbsp;Server.MapPath(".") &nbsp;<BR>&nbsp;<BR>set &nbsp;objExcelApp 
            &nbsp;= &nbsp;CreateObject("Excel.Application") 
            &nbsp;<BR>objExcelApp.DisplayAlerts &nbsp;= &nbsp;false 
            &nbsp;<BR>objExcelApp.Application.Visible &nbsp;= &nbsp;false 
            &nbsp;<BR>objExcelApp.WorkBooks.Open(strAddr &nbsp;&amp; 
            &nbsp;"\Templet\Null.xls") &nbsp;<BR>set &nbsp;objExcelBook &nbsp;= 
            &nbsp;objExcelApp.ActiveWorkBook &nbsp;<BR>set &nbsp;objExcelSheets 
            &nbsp;= &nbsp;objExcelBook.Worksheets &nbsp;<BR>set 
            &nbsp;objExcelSheet &nbsp;= &nbsp;objExcelBook.Sheets(1) 
            &nbsp;<BR>&nbsp;<BR>objExcelSheet.Range("B2:k2").Value &nbsp;= 
            &nbsp;Array("Week1", &nbsp;"Week2", &nbsp;"Week3", &nbsp;"Week4", 
            &nbsp;"Week5", &nbsp;"Week6", &nbsp;"Week7", &nbsp;"Week8", 
            &nbsp;"Week9", &nbsp;"Week10") 
            &nbsp;<BR>objExcelSheet.Range("B3:k3").Value &nbsp;= 
            &nbsp;Array("67", &nbsp;"87", &nbsp;"5", &nbsp;"9", &nbsp;"7", 
            &nbsp;"45", &nbsp;"45", &nbsp;"54", &nbsp;"54", &nbsp;"10") 
            &nbsp;<BR>objExcelSheet.Range("B4:k4").Value &nbsp;= 
            &nbsp;Array("10", &nbsp;"10", &nbsp;"8", &nbsp;"27", &nbsp;"33", 
            &nbsp;"37", &nbsp;"50", &nbsp;"54", &nbsp;"10", &nbsp;"10") 
            &nbsp;<BR>objExcelSheet.Range("B5:k5").Value &nbsp;= 
            &nbsp;Array("23", &nbsp;"3", &nbsp;"86", &nbsp;"64", &nbsp;"60", 
            &nbsp;"18", &nbsp;"5", &nbsp;"1", &nbsp;"36", &nbsp;"80") 
            &nbsp;<BR>objExcelSheet.Cells(3,1).Value="Internet &nbsp;Explorer" 
            &nbsp;<BR>objExcelSheet.Cells(4,1).Value="Netscape" 
            &nbsp;<BR>objExcelSheet.Cells(5,1).Value="Other" 
            &nbsp;<BR>&nbsp;<BR>objExcelSheet.Range("b2:k5").Select 
            &nbsp;<BR>&nbsp; &nbsp; &nbsp; &nbsp; 
            &nbsp;<BR>objExcelApp.Charts.Add 
            &nbsp;<BR>objExcelApp.ActiveChart.ChartType &nbsp;= &nbsp;97 
            &nbsp;<BR>objExcelApp.ActiveChart.BarShape &nbsp;=3 
            &nbsp;<BR>objExcelApp.ActiveChart.HasTitle &nbsp;= &nbsp;True 
            &nbsp;<BR>objExcelApp.ActiveChart.ChartTitle.Text &nbsp;= 
            &nbsp;"Visitors &nbsp;log &nbsp;for &nbsp;each &nbsp;week 
            &nbsp;shown &nbsp;in &nbsp;browsers &nbsp;percentage" 
            &nbsp;<BR>objExcelApp.ActiveChart.SetSourceData 
            &nbsp;objExcelSheet.Range("A1:k5"),1 
            &nbsp;<BR>objExcelApp.ActiveChart.Location &nbsp;1 
            &nbsp;<BR>'objExcelApp.ActiveChart.HasDataTable &nbsp;= &nbsp;True 
            &nbsp;<BR>'objExcelApp.ActiveChart.DataTable.ShowLegendKey &nbsp;= 
            &nbsp;True &nbsp;<BR>&nbsp;<BR>objExcelBook.SaveAs &nbsp;strAddr 
            &nbsp;&amp; &nbsp;"\Temp\Excel.xls" &nbsp;<BR>objExcelApp.Quit 
            &nbsp;<BR>set &nbsp;objExcelApp &nbsp;= &nbsp;Nothing 
            &nbsp;<BR>%&gt; &nbsp;<BR>&lt;!DOCTYPE &nbsp;HTML &nbsp;PUBLIC 
            &nbsp;"-//W3C//DTD &nbsp;HTML &nbsp;4.0 &nbsp;Transitional//EN"&gt; 
            &nbsp;<BR>&lt;HTML&gt; &nbsp;<BR>&lt;HEAD&gt; 
            &nbsp;<BR>&lt;TITLE&gt; &nbsp;New &nbsp;Document 
            &nbsp;&lt;/TITLE&gt; &nbsp;<BR>&lt;META &nbsp;NAME="Generator" 
            &nbsp;CONTENT="Microsoft &nbsp;FrontPage &nbsp;5.0"&gt; 
            &nbsp;<BR>&lt;META &nbsp;NAME="Author" &nbsp;CONTENT=""&gt; 
            &nbsp;<BR>&lt;META &nbsp;NAME="Keywords" &nbsp;CONTENT=""&gt; 
            &nbsp;<BR>&lt;META &nbsp;NAME="Description" &nbsp;CONTENT=""&gt; 
            &nbsp;<BR>&lt;/HEAD&gt; &nbsp;<BR>&lt;BODY&gt; 
            &nbsp;<BR>&lt;/BODY&gt; &nbsp;<BR>&lt;/HTML&gt; 
            &nbsp;<BR>&nbsp;<BR>我在这儿再提供。将网页中表格,保存的方法。 &nbsp;<BR>例如:TABLE &nbsp;的 
            &nbsp;ID=MYTABLE &nbsp;<BR>&lt;!--生成EXCEL文件--&gt; &nbsp;<BR>sub 
            &nbsp;btnExport_onclick() &nbsp;<BR>&nbsp; &nbsp;dim &nbsp;objExcel 
            &nbsp;<BR>&nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp;on 
            &nbsp;error &nbsp;resume &nbsp;next &nbsp; &nbsp;<BR>&nbsp;&nbsp; 
            &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp;Set &nbsp;objExcel &nbsp;= 
            &nbsp;CreateObject("excel.application") &nbsp;<BR>&nbsp;&nbsp; 
            &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; 
            &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; 
            &nbsp;&nbsp;With &nbsp;objExcel &nbsp; &nbsp;<BR>&nbsp;&nbsp; 
            &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; 
            &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; 
            &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; 
            &nbsp;&nbsp;.visible &nbsp;=true &nbsp;<BR>&nbsp;&nbsp; &nbsp;&nbsp; 
            &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; 
            &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; 
            &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp;.workbooks.add 
            &nbsp;<BR>&nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; 
            &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; 
            &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; 
            &nbsp;&nbsp; &nbsp;&nbsp;.sheets("sheet1").select 
            &nbsp;<BR>&nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; 
            &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; 
            &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; 
            &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;<BR>&nbsp;&nbsp; &nbsp;&nbsp; 
            &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; 
            &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp;End 
            &nbsp;with &nbsp;<BR>&nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; 
            &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; 
            &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp;m_row="0" 
            &nbsp;<BR>&nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; 
            &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; 
            &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp; &nbsp; &nbsp; 
            &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp; 
            &nbsp;<BR>&nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; 
            &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; 
            &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp; &nbsp; &nbsp; 
            &nbsp;for &nbsp;a=0 &nbsp;to 
            &nbsp;document.all.mytable.rows.length-1 &nbsp;<BR>&nbsp;&nbsp; 
            &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; 
            &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; 
            &nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;m_row 
            &nbsp;= &nbsp;cstr(int &nbsp;(m_row)+1) &nbsp;<BR>&nbsp;&nbsp; 
            &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; 
            &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; 
            &nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;for &nbsp;b=0 
            &nbsp;to &nbsp;document.all.mytable.rows(a).cells.length-1 
            &nbsp;<BR>&nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; 
            &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; 
            &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 
            &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;m_col &nbsp;= 
            &nbsp;chr(asc("A")+b) &nbsp;<BR>&nbsp;&nbsp; &nbsp;&nbsp; 
            &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; 
            &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; 
            &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 
            &nbsp; &nbsp; &nbsp;objexcel.range(m_col&amp;m_row).select 
            &nbsp;<BR>&nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; 
            &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; 
            &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 
            &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;M_value 
            &nbsp;= &nbsp;document.all.mytable.rows(a).cells(b).innerText 
            &nbsp;<BR>&nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; 
            &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; 
            &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; 
            &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; 
            &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; 
            &nbsp;&nbsp;objexcel.activecell.value=cstr(m_value) 
            &nbsp;<BR>&nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; 
            &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; 
            &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; 
            &nbsp;&nbsp; &nbsp;&nbsp; &nbsp; &nbsp;next &nbsp; &nbsp; &nbsp; 
            &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<BR>&nbsp;&nbsp; 
            &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; 
            &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; 
            &nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;next &nbsp; &nbsp; 
            &nbsp;<BR>&nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; 
            &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; 
            &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp;objexcel.visible=true 
            &nbsp;<BR>&nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; 
            &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; 
            &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp;objexcel.range("A1").select 
            &nbsp;<BR>End &nbsp;sub 
  &nbsp;<BR><BR></TD></TR></TBODY></TABLE></TD></TR></TBODY></TABLE><BR>
<TABLE align=center border=0 cellPadding=2 cellSpacing=0 id=footer width=770>
  <TBODY>
  <TR>
    <TD align=middle class=tdt>
      <P align=center></P></TD></TR></TBODY></TABLE><BR></BODY></HTML>

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -