vba 创建excel 文件

sub Create(paths,files)

Dim w As Workbook
    Set w = Application.Workbooks.Add
    On Error Resume Next
    w.SaveAs Filename:=paths & "\" & files & ".xlsx"             '在此输入新建工作簿的文件名,包括完整路径和扩展名
    On Error Resume Next
    Sheets("sheet1").name = files                                              '将sheet重命名为文件名

call other
    w.Save
    w.Close

end sub

sub other

msgbox "其他功能"

end sub

猜你喜欢

转载自blog.csdn.net/liliaq/article/details/54963034