Dec 20 2018 03:31 PM
I desperately hope someone can help.I have some simple VBA code that makes a copy of a single worksheet and saves it to a shared folder on Business OneDrive, the main bit of code is just:
Sheets("Data").Select
Sheets("Data").Copy
ActiveWorkbook.SaveAs Filename:="https:// blah /bla".
, FileFormat:=6, CreateBackup:=False
It works perfectly.BUT when I share the folder for my client, it asks for credentials for the correct directory on OneDrive and goes into an infinite loop asking the user to login, receive a code, login again,receive a code......and then gives the error error "1004 method save as of object workbook failed". I should add the client can view the same shared directory and upload the same file or any file manually with no problem whatsoever !
It all seems to have something to do with credentials but only gives a problem with VBA. Even more strangely in further testing,the VBA worked the first time on both a corporate account and a personal account but the second time it did not work at all on the same accounts with the same credentials.. We had no problem uploading files to the shared folder manually. This problem is delaying a huge Power BI Project for a government client.
Dec 21 2018 03:25 AM
Dec 21 2018 02:10 PM
Thank you for your reply.This is an interesting suggestion, however I am not quite sure how to implement it. If you could walk me through it would be helpful.The workbook is a standalone app that exports the single "Data" worksheet to MY business OneDrive with VBA. How do I synch MY OneDrive URL directory to the users PC?
Dec 24 2018 03:04 AM