Periodically saving a file to Sharepoint is failing
99% of the time, the following code executes properly, but on those rare occasions, the file being saved to sharepoint fails. We know the script works properly, because when we check after the DoCmd.OutputTo command completes, the modification date indicates ofile was updated.
DoCmd.Hourglass True
DoCmd.SetWarnings False
If FreqChoice = "Daily" Then
Me.txtStatus = "Processing.... Updating the Daily Cumulative file"
Build_Daily_Cumulative
ofile = "\corpshare\corp\Rev_Cycle_QA_Reports\Shared\NPI\Cumulative\Cumulative Results.xlsx"
Me.txtStatus = "Processing... The Daily Cumulative file is being exported to the network shared drive"
DoCmd.OutputTo acOutputTable, "t10_NPI_Daily_Cumulative", acFormatXLSX, ofile
Me.txtStatus = "Processing... The Daily Cumulative file is being exported to the SHAREPOINT folder"
Set oxl = CreateObject("Excel.application")
Set oBooks = oxl.Workbooks
Set oBook = oBooks.Open(ofile, False, False)
FleName = "Cumulative Results.xlsx"
SharePointURL = "https://novanthealth.sharepoint.com/sites/RCSQA2-NPIAudit/Shared Documents/NPI Audit/Cumulative/"
ShrPointPath = SharePointURL & FleName
oxl.ActiveWorkbook.SaveAs FileName:=ShrPointPath, FileFormat:=51
oxl.Quit
Set oxl = Nothing
End IfHow do I acquire the LastModifiedDate from Sharepoint?
What additional code is needed to check for LastModifiedDate?