|
写到E盘,运行完会自己出现一个实习名单的xls,下面的可以参考下,直接写的 没调试。。有问题你就调调看
FilePath = "E:\实习名单.xls"
Set Fso = CreateObject("Scripting.FileSystemObject")
If Fso.FileExists(FilePath) = False Then
Set objExcel = CreateObject("Excel.Application")
Set objWorkBook = objExcel.Workbooks.Add
Set objWorkSheet = objWorkBook.ActiveSheet
iRow = Browser("09级已办理离校顶岗实习名单-新闻中心").Page("09级已办理离校顶岗实习名单-新闻中心").WebTable("最近更新").RowCount
For i = 1 to iRow
iColumn = Browser("09级已办理离校顶岗实习名单-新闻中心").Page("09级已办理离校顶岗实习名单-新闻中心").WebTable("最近更新").ColumnCount(i)
For j = 1 to iColumn
cellData = Browser("09级已办理离校顶岗实习名单-新闻中心").Page("09级已办理离校顶岗实习名单-新闻中心").WebTable("最近更新").GetCellData(i,j)
objWorkSheet.Cells(i,chr(64+j)) = cellData
Next
Next
objWorkBook.SaveAs(FilePath)
objExcel.Workbooks.Close
objExcel.Quit
Set objWorkBook = Nothing
Set objExcel = Nothing
End If |
|