本文介绍了办法从.xls的转换通过一个批处理文件或VBA来.XLSM?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
如何我自动化的.xls工作簿转换为.XLSM?
How to I automate the conversion of .xls workbooks to .xlsm?
推荐答案
您可以试试这个code:
You can try this code:
Sub TrandformAllXLSFilesToXLSM()
Dim myPath As String
myPath = "C:\Excel\"
WorkFile = Dir(myPath & "*.xls")
Do While WorkFile <> ""
If Right(WorkFile, 4) <> "xlsm" Then
Workbooks.Open FileName:=myPath & WorkFile
ActiveWorkbook.SaveAs FileName:= _
myPath & WorkFile & "m", FileFormat:= _
xlOpenXMLWorkbookMacroEnabled, CreateBackup:=False
ActiveWorkbook.Close
End If
WorkFile = Dir()
Loop
End Sub
请参阅此了解更多信息
这篇关于办法从.xls的转换通过一个批处理文件或VBA来.XLSM?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!