Beste,
Onderstaande code werkt prima zolang het bestand op dezelfde drive staat.
Ik heb het bestand nu op de juiste locatie gezet (sharepoint) en dan loopt deze vast op
".SaveAs filename:=path & fname, FileFormat:=51"
Hoe kan ik dit oplossen
Private Sub SaveCopy()
Dim filename
Dim path As String
Dim dt As String
If TimeValue(Now) < TimeValue("12:00:00 PM") Then
meridian = "AM"
Else
meridian = "PM"
End If
path = "C"
dt = Format(Now(), "yyyy-mm-dd hhmm")
fname = "Projectplanning" & dt & meridian
Application.DisplayAlerts = False
Sheet8.Copy
Application.Run "Module2.Clear_ButtonsActiveSheet"
Application.Run "Module2.Break_Links"
With ActiveWorkbook
.SaveAs filename:=path & fname, FileFormat:=51
.Close
End With
Application.DisplayAlerts = True
End Sub
Onderstaande code werkt prima zolang het bestand op dezelfde drive staat.
Ik heb het bestand nu op de juiste locatie gezet (sharepoint) en dan loopt deze vast op
".SaveAs filename:=path & fname, FileFormat:=51"
Hoe kan ik dit oplossen
Private Sub SaveCopy()
Dim filename
Dim path As String
Dim dt As String
If TimeValue(Now) < TimeValue("12:00:00 PM") Then
meridian = "AM"
Else
meridian = "PM"
End If
path = "C"
dt = Format(Now(), "yyyy-mm-dd hhmm")
fname = "Projectplanning" & dt & meridian
Application.DisplayAlerts = False
Sheet8.Copy
Application.Run "Module2.Clear_ButtonsActiveSheet"
Application.Run "Module2.Break_Links"
With ActiveWorkbook
.SaveAs filename:=path & fname, FileFormat:=51
.Close
End With
Application.DisplayAlerts = True
End Sub