自动保存特定的工作簿

时间:2016-05-08 14:26:53

标签: excel vba excel-vba excel-formula

find_by(followed_id: other_user.id)

如何保存已打开的特定工作簿

1 个答案:

答案 0 :(得分:0)

您可以像这样循环打开工作簿

For Each w In Application.Workbooks 

    'You can simply save the current book
    w.Save 

    'Or get the name and save it to a location as you were

    Dim FileName As String
    FileName = ActiveWorkbook.Name
    ActiveWorkbook.SaveAs FileName:="C:\Users\PC\Desktop\" & FileName, FileFormat:=xlOpenXMLWorkbookMacroEnabled, CreateBackup:=False

Next w