For dtn = 0 To UBound(arr) '遍历解压文件
filerar = ThisWorkbook.Path & "\报告表" & arr(dtn) & ".*"
If Dir(filerar) <> "" Then
VBA.MkDir (ThisWorkbook.Path & "\报告表" & arr(dtn)) '创建文件夹
filepath = ThisWorkbook.Path & "\报告表" & arr(dtn) & "\" '解压的位置
filestring = rarexe & " e " & filerar & " -o" & filepath
result = Shell(filestring, vbHide)
End If
Next
'傻瓜式改名
On Error Resume Next
Name ThisWorkbook.Path & "\报告表WX.rar" As ThisWorkbook.Path & "\报告表 (date=" & PRD & ") from WX.rar"
Name ThisWorkbook.Path & "\报告表SH.rar" As ThisWorkbook.Path & "\报告表 (date=" & PRD & ") from SH.rar"
Name ThisWorkbook.Path & "\报告表WX" As ThisWorkbook.Path & "\报告表 (date=" & PRD & ") from WX"
Name ThisWorkbook.Path & "\报告表SH" As ThisWorkbook.Path & "\报告表 (date=" & PRD & ") from SH"
'将汇总表复制出来
For dtn_pdf = 0 To UBound(arr) '遍历解压文件
file_sum = ThisWorkbook.Path & "\报告表 (date=" & PRD & ") from " & arr(dtn_pdf)
sum_sht = Dir(file_sum & "\报告汇总*.*")
FileCopy file_sum & "\" & sum_sht, ThisWorkbook.Path & "\报告汇总 (date=" & PRD & ") from " & arr(dtn_pdf) & ".xlsx"
sum_sht = Dir
Next
Application.ScreenUpdating = True
For dtn = 0 To UBound(arr) '遍历解压文件
filerar = ThisWorkbook.Path & "\报告表" & arr(dtn) & ".*"
If Dir(filerar) <> "" Then
VBA.MkDir (ThisWorkbook.Path & "\报告表" & arr(dtn)) '创建文件夹
filepath = ThisWorkbook.Path & "\报告表" & arr(dtn) & "\" '解压的位置
filestring = rarexe & " x -ep " & filerar & filepath
result = Shell(filestring, vbHide)
End If
Next
'傻瓜式改名
On Error Resume Next
Name ThisWorkbook.Path & "\报告表WX.rar" As ThisWorkbook.Path & "\报告表 (date=" & PRD & ") from WX.rar"
Name ThisWorkbook.Path & "\报告表SH.rar" As ThisWorkbook.Path & "\报告表 (date=" & PRD & ") from SH.rar"
Name ThisWorkbook.Path & "\报告表WX" As ThisWorkbook.Path & "\报告表 (date=" & PRD & ") from WX"
Name ThisWorkbook.Path & "\报告表SH" As ThisWorkbook.Path & "\报告表 (date=" & PRD & ") from SH"
'将汇总表复制出来
For dtn_pdf = 0 To UBound(arr) '遍历解压文件
file_sum = ThisWorkbook.Path & "\报告表 (date=" & PRD & ") from " & arr(dtn_pdf)
sum_sht = Dir(file_sum & "\报告汇总*.*")
FileCopy file_sum & "\" & sum_sht, ThisWorkbook.Path & "\报告汇总 (date=" & PRD & ") from " & arr(dtn_pdf) & ".xlsx"
sum_sht = Dir
Next
Application.ScreenUpdating = True