Sub 批量打印设置() Dim lj Set objShell = CreateObject("Shell.Application") Set objFolder = objShell.BrowseForFolder(0, "选择文件夹", 0, 0) If objFolder Is Nothing Then MsgBox "未选择文件夹" Exit Sub End If lj = objFolder.self.Path If Right(lj, 1) <> "\" Then lj = lj & "\" End If Set objFolder = Nothing Set objShell = Nothing myFile = Dir(lj & "*.xls") While myFile <> "" Workbooks.Open lj & myFile '这里放入打印设置代码,可通过录制宏来自动生成,然后拷贝到此处 ActiveWorkbook.Close 1 myFile = Dir WendEnd Sub