Results 1 to 2 of 2
  1. #1
    mrmims is offline Advanced Beginner
    Windows 7 64bit Access 2007
    Join Date
    Jul 2013
    Posts
    53

    Export to PDF to network folder not working?

    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!

  2. #2
    Micron is online now Virtually Inert Person
    Windows 7 32bit Access 2007
    Join Date
    Jun 2014
    Location
    Ontario, Canada
    Posts
    12,737
    Two possibilites:
    1) don't user arithmetic operators to concatenate strings. Use the ampersand &
    2) AFAIK, you cannot upload a file to a secure web server (https) like this. You'd need an ftp program.
    If the sharepoint server is part of the network you are on, use its drive path the same as you would any other network drive.
    The more we hear silence, the more we begin to think about our value in this universe.
    Paraphrase of Professor Brian Cox.

Please reply to this thread with any new information or opinions.

Similar Threads

  1. Create a folder into a network location
    By charly.csh in forum Access
    Replies: 7
    Last Post: 12-04-2015, 10:02 AM
  2. Zip a folder on the network using vba
    By dj59 in forum Programming
    Replies: 2
    Last Post: 04-24-2015, 11:01 AM
  3. Save file as a different user to a network folder
    By rstruck in forum Programming
    Replies: 4
    Last Post: 05-10-2014, 04:53 PM
  4. Hyperlink to open folder on network
    By angie in forum Forms
    Replies: 3
    Last Post: 12-10-2013, 10:22 AM
  5. Replies: 3
    Last Post: 06-04-2013, 09:51 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums