我有这段代码,一切正常,但我不知道如何让它保留原始文件名:
Set app = CreateObject("Excel.Application")
app.Visible = False
app.DisplayAlerts = False
Set fso = CreateObject("Scripting.FileSystemObject")
For Each f In fso.GetFolder("F:\Billing_Common\autoemail").Files
If LCase(fso.GetExtensionName(f)) = "xlsx" Then
Set wb = app.Workbooks.Open(f.Path)
filename = f
wb.SaveAs "F:\Billing_Common\autoemail\filename.xls", -4143
wb.Close SaveChanges=True
End if
Next
app.Quit
Set app = Nothing
Set fso = Nothing
任何帮助将非常感激!
谢谢