<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>无标题文档</title>
</head>
<script language="vbscript">
sub btnExport_onclick()
dim objExcel
on error resume next
Set objExcel = CreateObject("excel.application")
With objExcel
.visible =true
.workbooks.add
.sheets("sheet1").select
End with
m_row="0"
for a=0 to document.all.mytable.rows.length-1
m_row = cstr(int (m_row)+1)
for b=0 to document.all.mytable.rows(a).cells.length-1
m_col = chr(asc("A")+b)
objexcel.range(m_col&m_row).select
M_value = document.all.mytable.rows(a).cells(b).innerText
objexcel.activecell.value=cstr(m_value)
next
next
m_row="0"
for a=0 to document.all.mytable2.rows.length-1
m_row = cstr(int (m_row)+1)
for b=0 to document.all.mytable2.rows(a).cells.length-1
m_col = chr(asc("E")+b)
objexcel.range(m_col&m_row).select
M_value = document.all.mytable2.rows(a).cells(b).innerText
objexcel.activecell.value=cstr(m_value)
next
next
objexcel.visible=true
objexcel.range("A1").select
End sub