Hello,
I've got an issue with FIleCopy command in VBA. I always used this when i wanted to copy/paste some file from one folder to another. (but it was local or based on the server).
Unfortunately at that moment i have to wokr with onedrive solution. I need to build some file (or rather wanna to add simple ribbon button*xlam to my colleagues), which will show simple userform with some textxbox to fill in and "attache" PDF file as well which should be saved in my folder (which of course is shared for others). In userform i added command button to indicate which file should be attached (user should choose one PDF file e.g invoice). Then this macro should copy this file and paste it to the folder shared by me.
path to my folder will be:
https:\\19retail-my.sharepoint.com\personal\luk_swi\Documents\Desktop\Invoices
Unfortunately FileCopy doesnt work (or i do something wrong) if paths are connected to onedrive/sharepoint.
I tried as well to first open this indicated file (ActiveWorkbook.FollowHyperlink PDF_path) and its working correct but then i cannot save this "opened" pdf to my : https:\\19retail-my.sharepoint.com\personal\luk_swi\Documents\Desktop\Invoices
Please help
Private Sub CommandButton1_Click()
Dim result As Variant
result = Application.GetOpenFilename("PDF Files (*.pdf), *.pdf")
If result <> False Then
FileTextBox.Text = result
End If
End Sub
I've got an issue with FIleCopy command in VBA. I always used this when i wanted to copy/paste some file from one folder to another. (but it was local or based on the server).
Unfortunately at that moment i have to wokr with onedrive solution. I need to build some file (or rather wanna to add simple ribbon button*xlam to my colleagues), which will show simple userform with some textxbox to fill in and "attache" PDF file as well which should be saved in my folder (which of course is shared for others). In userform i added command button to indicate which file should be attached (user should choose one PDF file e.g invoice). Then this macro should copy this file and paste it to the folder shared by me.
path to my folder will be:
https:\\19retail-my.sharepoint.com\personal\luk_swi\Documents\Desktop\Invoices
Unfortunately FileCopy doesnt work (or i do something wrong) if paths are connected to onedrive/sharepoint.
I tried as well to first open this indicated file (ActiveWorkbook.FollowHyperlink PDF_path) and its working correct but then i cannot save this "opened" pdf to my : https:\\19retail-my.sharepoint.com\personal\luk_swi\Documents\Desktop\Invoices
Please help
Private Sub CommandButton1_Click()
Dim result As Variant
result = Application.GetOpenFilename("PDF Files (*.pdf), *.pdf")
If result <> False Then
FileTextBox.Text = result
End If
End Sub