PDA

View Full Version : [SOLVED:] Open an Excel on OneDrive



Bastringue
12-22-2023, 05:52 AM
Hello,

I am afraid this question looks classical but I cannot find any good response...

I have a 2-file Excel application : a Front-end and a Back-end (data)

I have put the backend on OneDrive and would like to connect the Front-end to it.

I have the "OneDrive" link wich reads like this: https://onedrive.live.com/edit?id=D0BC45.........nVlJmF0PTk&migratedtospo=true&wdo=2

I have tried something like this in my VBA code:

Workbooks.Open(Filename:=lienPartage).Activate

But it just fails when trying to open the file...
Yet, the OneDrive link itself is OK as when I put it in my browser, it opens it.

Would you know how to connect my Front-end Excel to the Back-end, and to open it (with read/write access) ?

Thanks anyhow for your advice,
Pierre

Bastringue
12-23-2023, 09:54 AM
I have a partial response to my question. It seems that the good way to connect to a Back-end located on OneDrive is to install the OneDrive Application and use the local OneDrive directory as a 'normal' directory.

Consequently, we can open this Back-end file from VBA as usual:

Set Base = Workbooks.Open("C:\\Users\Pierre\OneDrive\Documents\BackEnd.xlsm")
Base.Windows(1).Visible = False
Any modification we do on this Back-end will be synchronized with the 'image' file on the Cloud...it's fine.

However, I wonder how an authorized person can do the same ?
If by managing the sharing of this file on the cloud, I have authorized someone to have a shared link, what does this person have to do in order to connect its Front-End to this Back-end ?
I guess this person must also have a OneDrive and what else ?

Bastringue
12-25-2023, 12:15 PM
My problem is solved and I have given the response to my question here (https://www.excelforum.com/excel-programming-vba-macros/1416997-connect-an-excel-file-to-another-one-located-on-onedrive.html#post5903313)