Hello to the VBA Developers
I'd like to write to a mapped network drive ( P:\)
The following code doesn't seem to function and generates the error executing 76. Could you explain to me the reason for this error and how to resolve it?
Thank you very much for your advice in advance.
Sub Enregistre_Fichier_bon_nom_bon_endroit()
ChDrive "P"
ChDir "P:\SG\INFOR\"
Repertoire = Sheets("MAJ").Range("B1").Value & "\" & Sheets("FICHE_DEMANDE").Range("AH2").Value & "\"
ChDir Repertoire
SaveFileName = CurDir & "\" & Sheets("FICHE_DEMANDE").Range("B14").Value & "_" & Sheets("FICHE_DEMANDE").Range("a4").Value & "_ Suivi_FIR_directions_metier_2015_"
MsgBox (SaveFileName)
Set REP = Application.FileDialog(msoFileDialogSaveAs)
With REP
.AllowMultiSelect = False
.InitialFileName = SaveFileName
.FilterIndex = 2
If .Show = -1 Then
ActiveWorkbook.SaveAs Filename:=SaveFileName, FileFormat:=xlOpenXMLWorkbookMacroEnabled, CreateBackup:=False
End If
End With
End Sub