Periodically saving a file to Sharepoint is failing

D'Ingillo, Dave G 0 Reputation points
2024-12-10T14:00:43.05+00:00

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?

Excel
Excel
A family of Microsoft spreadsheet software with tools for analyzing, charting, and communicating data.
2,052 questions
Access
Access
A family of Microsoft relational database management systems designed for ease of use.
420 questions
SharePoint
SharePoint
A group of Microsoft Products and technologies used for sharing and managing content, knowledge, and applications.
11,004 questions
0 comments No comments
{count} votes

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.