vbscript生成EXCEL
来源:互联网 发布:新浪php面试题 编辑:程序博客网 时间:2024/05/16 18:20
vbscript生成EXCEL
<SCRIPT LANGUAGE="VBScript">
<!--
Sub PrintList(table,title)
'复制到剪贴板
'document.execCommand "copy"
'导出到Excel
dim app, book, sheet
err.number = 0
on error resume next
set app = CreateObject("Excel.Application")
app.Visible = True
if err.number <> 0 then
msgbox "请确认您已经正确安装Microsoft Excel 2000以上版本,并正确配置浏览器安全设置。"
exit sub
end if
Set book = app.Workbooks.Add
Set sheet = book.ActiveSheet
If sheet Is Nothing Then
Set sheet = book.Sheets.Add
End If
sheet.Cells.Select
app.Selection.NumberFormatLocal = "@"
dim i, j
set titlerow = title.rows(0)
sheet.Cells(1,1) = titlerow.cells(0).innerText
for i = 0 to table.rows.length - 1
set row = table.rows(i)
for j = 0 to row.cells.length - 1
sheet.Cells(i + 2, j + 1) = row.cells(j).innerText
next
next
rowCount = table.rows.length
colCount = table.rows(0).cells.length
'自动调整行高列宽
app.Range(sheet.Cells(2, 1), sheet.Cells(rowCount, colCount)).Select
app.Selection.Rows.AutoFit
app.Selection.Columns.AutoFit
app.Selection.Rows.AutoFit
'设置表头格式
app.Range(sheet.Cells(1, 1), sheet.Cells(1, colCount)).Select
app.Selection.Merge
app.Range(sheet.Cells(1, 1), sheet.Cells(1, colCount)).Select
app.Selection.Font.Bold = True
app.Selection.Font.Size = 15
app.Range(sheet.Cells(1, 1), sheet.Cells(1, colCount)).HorizontalAlignment = xlCenter
sheet.PrintOut
End Sub
-->
</SCRIPT>
- vbscript生成EXCEL
- vbscript 和 javascript 生成 Excel 文件[office 2000].
- vbscript直接生成WORD
- vbscript生成静态页面
- VBSCRIPT 生成 WORD
- 用VBScript导出EXCEL报表
- VBSCRIPT 生成 WORD 又一法
- VbScript Add SAP Output Excel style...
- vbscript 中对excel常见操作[转]
- 如何学习用VBScript操作Excel
- VBScript调用Excel.Application开发指引
- 自己对VBSCRIPT生成WORD的整合.....
- VBScript
- VBScript
- vbscript
- vbscript
- VBScript
- VBScript
- 一种不堪忍受的戒律
- Oracle中Trigger例子1
- 从硬盘安装Linux
- 一个比较多韩国设计的网站模板下载站点
- AscII 字符表
- vbscript生成EXCEL
- php的加密。
- 扬扬的J2EE学习笔记(三)Components and Roles组件和角色
- 关于Log4j比较全面的配置
- Windows 2003环境下Internet信息服务(IIS)安装配置
- 网页里嵌入JavaScript 验证空,汉字,字母,数字,长度输入
- attribute与property的区别?
- 希腊字母发音对照表
- Oracle中Trigger例子2