Function DoXlsRead(byval sFile,ByVal dDate)
dim alldata
allData = ""
for intJ = 0 to ielistFile.listCount -1
if ielistFile.selected(intJ) then
sFiletemp = sFile & ielistFile.list(intJ)
data = AutoreadExcel(sFiletemp,dDate,ielistFile.list(intJ))
If data<>"" Then
allData = typestr & vbtab & dDate & vbtab & data
if intJ < ielistFile.listCount -1 then
allData = allData & vbcrlf
end if
end if
end if
next
End Function
function AutoreadExcel(filename,dDate,xlsfilename)
dim xlApp
dim xlBook
dim PointSheet
dim c
dim r
dim zh
dim ye
dim lhh
dim Str
dim data
Set xlApp = CreateObject("Excel.Application") '创建EXCEL对象
Set xlBook = xlApp.Workbooks.Open(filename) '打开已经存在的EXCEL工件簿文件
xlApp.Visible = False '设置EXCEL对象不可见
Set PointSheet = xlBook.Worksheets.Item(1) '设置活动工作表
xlApp.DisplayAlerts = false
xlApp.Application.EnableEvents = False'禁用事件
Dim i
dim j
c = "" '列数
r = "" '行数
Str=PointSheet.Cells(5,14).value& "#" & dDate & "#"
For i = 15 To PointSheet.UsedRange.Rows.Count '有效行个数
For j = 1 To 17 '有效列个数 ' PointSheet.UsedRange.Columns.Count
if trim(PointSheet.Cells(i,j).value)="" then
Str=Str & "0.00"&"_"
else
Str=Str&PointSheet.Cells(i,j).value&"_"
end if
if j = 17 then
Str=Str&"/r"
Exit For
end if
next
if PointSheet.Cells(i,1).value = "总计" then
Exit For
end if
next
window.parent.frames.gotop.waitingForResponse=true
data=psub.sendStringToServer(str,appRoot & "/QFServer?cmd=readQFChkData" & "&flag=readArgData" ,,sdata)
window.parent.frames.gotop.waitingForResponse=false
If trim(sdata)<>"" And sdata<>"Error" Then
msgbox xlsfilename+"帐户余额文件上传成功,可进行核对!"
else
msgbox xlsfilename+"文件上传失败"
end if
xlApp.Quit
Set xlApp = Nothing '交还控制给Excel
Set xlBook = Nothing
Set PointSheet = Nothing
End function