Sub Test()
Dim wb As Workbook, mPath As String, f As String
Application.DisplayAlerts = False
Application.ScreenUpdating = False
Application.Calculation = xlCalculationManual
If Workbooks.Count > 1 Then MsgBox "关闭其他工作簿后再试!": Exit Sub
MsgBox "选择.xlsx文件所在的文件夹!"
With Application.FileDialog(msoFileDialogFolderPicker)
.Show
.AllowMultiSelect = False
If .SelectedItems.Count = 0 Then MsgBox "你放弃了操作!": Exit Sub
mPath = .SelectedItems(1)
End With
f = Dir(mPath & "\*.xlsx")
Do While f <> ""
If f <> ThisWorkbook.Name And Left(f, Len(f) - 1) <> ThisWorkbook.Name Then
Set wb = Workbooks.Open(mPath & "\" & f, , False)
wb.SaveAs Filename:=mPath & "\" & Left(f, Len(f) - 1), FileFormat:=xlExcel8
wb.Close True
Kill mPath & "\" & f
End If
f = Dir
Loop
Application.DisplayAlerts = True
Application.ScreenUpdating = True
Application.Calculation = xlCalculationAutomatic
MsgBox "处理完成!"
End Sub
相关文章
- Excel宏将xlsx转换为xls
- 如何将xls转换为xlsx
- 有什么方法可以使用Apache POI同时读取.xls和.xlsx文件吗?
- 如何在ODOO上用excel (xls, xlsx)格式生成报告?
- 如何使用PHP将Excel XLS转换为CSV
- 将XML转换为HTML - 使用PHP和XLS模板
- 用Ruby解析XLS和XLSX (MS Excel)文件?
- 用于处理Excel文件的Python库(xls | xlsx)
- 使用Microsoft Office Compitablity Pack的excelcnv将xlsx转换为xls
- 将ibfs(从网站下载的Excel文件)文件转换为.xls / .xlsx文件格式,而无需使用C#Asp.net Web应用程序安装Office