小编Alb*_*hra的帖子

另存为 .XLSM 的 VBA 代码

需要帮助添加命令以另存为 .xlsm :-

Private Sub cmdSaveForm1_Click()
    Dim strFolder As String
    Dim i As Long

    'Find the position of the period in the file name
    i = InStr(ActiveWorkbook.Name, ".")

    'Create a default file name by concatenating the file name without the extention _
        plus the current date and time, and plus the xlsm extention
    Filename = Left(ActiveWorkbook.Name, i - 1) & "_" & Format(Now, "yyyy-mm-dd_hh mm") & ".xlsm"

    'Open Save As dialog to a default folder with default file name
    With …
Run Code Online (Sandbox Code Playgroud)

excel vba

5
推荐指数
1
解决办法
4万
查看次数

标签 统计

excel ×1

vba ×1