Hello,
I have code:
Code:
Private Sub Command74_Click()
Dim myPath As String
Dim strReportName As String
DoCmd.OpenReport "rpt_Inspection_Certification", acViewPreview
'myPath = "C:\Users\MrMims\Desktop\Text_Folder\"
myPath = "https://xxx.sharepoint.com/nationalrigging/xxx/Documents/"
strReportName = [Equipment_Barcode] + "_" + Format([Cert_Date], "yyyy_mm_dd") + "_Motor_Cert.pdf"
DoCmd.OutputTo acOutputReport, "", acFormatPDF, myPath + strReportName, False
DoCmd.Close acReport, "rpt_Inspection_Certification"
End Sub
I am trying to export a report to PDF, and then store in a folder in Sharepoint.
I can run the code perfectly when exporting to my desktop folder (commented out section), but when I run it with the Sharepoint path it seems to run exactly as it should but in the end I get a "OutputTo cancelled". And the VBA debug points to:
DoCmd.OutputTo acOutputReport, "", acFormatPDF, myPath + strReportName, False
What am I missing? Thank you for your help!