如果這些Excel檔案都在一個資料夾下,用宏可以實現。在該資料夾下新建一Excel,開啟它,同時按Alt和F11進入宏介面,點選單的插入,模組,貼上如下程式碼: Sub Find() Application.ScreenUpdating = False Application.DisplayAlerts = False On Error GoTo Line1 Dim MyDir As String MyDir = ThisWorkbook.Path & "" ChDrive Left(MyDir, 1) ChDir MyDir Match = Dir$("*.xlsx") Do If Not LCase(Match) = LCase(ThisWorkbook.Name) Then Workbooks.Open Match, 0 ActiveWorkbook.SaveAs Replace(Match, ".xlsx", ".xls") ActiveWorkbook.Close 0 End If Match = Dir$ Loop Until Len(Match) = 0 Line1: Application.DisplayAlerts = True Application.ScreenUpdating = True End Sub 在此介面直接按F5執行此宏,所有的.xlsx檔案另存為.xls。
如果這些Excel檔案都在一個資料夾下,用宏可以實現。在該資料夾下新建一Excel,開啟它,同時按Alt和F11進入宏介面,點選單的插入,模組,貼上如下程式碼: Sub Find() Application.ScreenUpdating = False Application.DisplayAlerts = False On Error GoTo Line1 Dim MyDir As String MyDir = ThisWorkbook.Path & "" ChDrive Left(MyDir, 1) ChDir MyDir Match = Dir$("*.xlsx") Do If Not LCase(Match) = LCase(ThisWorkbook.Name) Then Workbooks.Open Match, 0 ActiveWorkbook.SaveAs Replace(Match, ".xlsx", ".xls") ActiveWorkbook.Close 0 End If Match = Dir$ Loop Until Len(Match) = 0 Line1: Application.DisplayAlerts = True Application.ScreenUpdating = True End Sub 在此介面直接按F5執行此宏,所有的.xlsx檔案另存為.xls。