none
one drive RRS feed

  • Question


  • i use the vba program in excel  to save pdf files on my local disk and that works well. but now I want that these are no longer on my local disk but in the cloud of onedrive so that I can also when I am mobile with my tablet. can you tell me how to do that with the help of vba



    • Edited by johan56 Wednesday, November 21, 2018 1:40 PM
    Wednesday, November 21, 2018 1:39 PM

All replies

  • Hi johan,

    You can try to change your path to where the onedrive is on your PC.

    For example, you can save files to OneDrive using Access VBA:

    Sub SaveToOnedrive
        Dim objFSO As New FileSystemObject
        Set objFSO = CreateObject("Scripting.FileSystemObject")
        objFSO.CopyFile "C:\Test File.txt", "C:\Users\" & 
        Environ("UserName") & "\OneDrive - Company", True
        Set objFSO = Nothing
    End Sub

    For more information, please review the following link:

    Save files to OneDrive using Access VBA

    Hopefully it helps you.

    Best Regards,

    Yuki


    MSDN Community Support Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread.


    Thursday, November 22, 2018 3:03 AM
    Moderator
  • Hi johan,

    Thanks for your asking. Did you resolve your issue? If the post helps you, you can mark it as answer and close the post.

    Thank you for understanding. If you have any question, or update, please feel free to let us know.

    I wish you a happy life!

    Best Regards,

    Yuki


    MSDN Community Support Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread.

    Tuesday, November 27, 2018 7:27 AM
    Moderator