Sub xls批量转换成xlsx()
Application.ScreenUpdating = False
MsgBox "现在开始转换,请稍候!"
mypath = ThisWorkbook.Path & "\"
mybook = Dir(mypath & "*.xls")
Do While Len(mybook)
Set wb = Workbooks.Open(mypath & mybook)
wb.SaveAs mypath & mybook & "x", xlOpenXMLWorkbook
wb.Close
p = p + 1
Application.StatusBar = "已转换" & p & "个工作薄"
If p Mod 5 = 0 Then DoEvents
Loop
Application.StatusBar = ""
MsgBox "全部转换完成!共 " & p & " 个!"
End Sub
时间: 2024-11-05 19:44:10