I run several reports using macros and save them into SharePoint. I use the code below when saving. The issue I'm having is intermittent. As it starts the save process it stalls when the "Content Type" dialog box appears. If I close the dialog box by manually clicking on the X the macro moves on and the "Uploading to SharePoint" dialog box appears where it stalls again. If I let is set for a few seconds and click the X on the dialog box the macro finishes and the file actually is saved to the proper folder. Many times it saves without stalling. The first save is for historical records the second one overwrites a file that is linked to other places. Thank you in advance for your help.
VBA Code:
Function WebSave_DWOR()
Application.DisplayAlerts = False
FilePath = "http://collab.company.com/facsec/mtvfacilities/PMO/documentation/Shared Documents/FMS/WEEKLY WO REPORTS/": NewName = FilePath & Format(Date, "YYYY-MM-DD") & " Demand Work Order Report" & ".xlsx"
ActiveWorkbook.SaveAs Filename:=NewName, FileFormat _
:=51, CreateBackup:=False
FilePath = "http://collab.company.com/facsec/mtvfacilities/PMO/documentation/Shared Documents/FMS/": NewName = FilePath & "Daily Demand Work Order Report " & ".xlsx"
ActiveWorkbook.SaveAs Filename:=NewName, FileFormat _
:=51, CreateBackup:=False
Application.DisplayAlerts = True
ActiveWorkbook.Close
End Function