首页 > 解决方案 > 当我将 excel 版本更改为 excel 2016 时出现错误运行时间 1004 vba

问题描述

我需要你的帮助。在我们公司,我们的 excel 文件存在问题,因为我们更改了 excel 版本并下载了 excel 2016,我们遇到了错误 1004。

在其他计算机上它工作得很好。

Private Sub SauvValid()
'-------------------------------------------------------------------------
' SAUVEGARDE DANS LE REPERTOIRE SPECIAL DE SAUVEGARDE
'-------------------------------------------------------------------------

' sauvegarde du fichier dans l'emplacement de sauvegarde mensuelle
    nomFichier = Left(ThisWorkbook.Name, Len(ThisWorkbook.Name) - 18)
    repertoireSauv = ThisWorkbook.Path & "\"
    repertoire = ThisWorkbook.Path & "\" & Format(Sheets("Calcul Indexe").Range("B1").Value, "yyyy") & "\" & _
            Format(Sheets("Calcul Indexe").Range("B1").Value, "mm") & "-" & Format(Sheets("Calcul Indexe").Range("B1").Value, "mmmm") & "\"
    Call GESTION_DROITS.Masquage
    Application.DisplayAlerts = False
    ActiveWorkbook.SaveAs Filename:=repertoire & nomFichier & "SvEnvoiValid-" & _
        Format(Sheets("Calcul Indexe").Range("B1").Value, "yyyymmdd") & "-" & Format(Time, "hhmm") & ".xlsm", _
        FileFormat:=xlOpenXMLWorkbookMacroEnabled, CreateBackup:=False

' sauvegarde du fichier de façon normale incrementale
    nomFichier = nomFichier & Format(Sheets("Calcul Indexe").Range("B1").Value, "yyyymmdd") & "-" & Format(Time, "hhmm") & ".xlsm"
    ChDir repertoireSauv
    ActiveWorkbook.SaveAs Filename:=repertoireSauv & nomFichier, _
        FileFormat:=xlOpenXMLWorkbookMacroEnabled, CreateBackup:=False
    Application.DisplayAlerts = True
    Call GESTION_DROITS.Affichage

End Sub

请提供任何帮助。在此处输入图像描述

标签: excelvba

解决方案


推荐阅读