mainrotor
asked on
How do I open files saved in Microsoft Onedrive using vba
Hi Experts,
I use the code below to open a file, in an ACCESS application, that's saved in "C:\Schedules\" file path. The app users will start saving the spreadsheets in Microsoft OneDrive. How do I rewrite my code so that it reads the files from Microsoft OneDrive? Thanks in advance.
mrotor
I use the code below to open a file, in an ACCESS application, that's saved in "C:\Schedules\" file path. The app users will start saving the spreadsheets in Microsoft OneDrive. How do I rewrite my code so that it reads the files from Microsoft OneDrive? Thanks in advance.
Const cstrFolder As String = "C:\Schedules\"
Dim i As Long, x As Long, lng As Long
Dim xlApp As Object
Dim xlWrk As Object
Dim xlSheet As Object
Dim sql As String
Dim strExt As String, strFile As String, strTable As String
Dim strFirstName As String, strLastName As String, strMonth As String
Set xlApp = VBA.CreateObject("Excel.Application")
xlApp.Visible = False
strExt = ".xls"
lng = Len(strExt)
strFile = Dir(cstrFolder & "*" & strExt)
If Len(strFile) = 0 Then
MsgBox "No Files Found"
Else
Do While Len(strFile) > 0
Set xlWrk = xlApp.Workbooks.Open(cstrFolder & strFile)
mrotor
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Thank you all for your suggestions. I will try them this coming week and post my results.
mrotor
mrotor
This question has been classified as abandoned and is closed as part of the Cleanup Program. See the recommendation for more details.
http://msdn.microsoft.com/en-us/library/dn631819.aspx
You'll want to look at "Using the REST API", which has things like how to sign onto a One Drive account.
Also the section "Move, copy, create, or delete a file or folder (REST)"
Jim.