+ Reply to Thread
Results 1 to 9 of 9

Use VBA to open a document from OneDrive and then edit it

  1. #1
    Forum Contributor
    Join Date
    05-24-2014
    MS-Off Ver
    Microsoft Office 2013
    Posts
    113

    Use VBA to open a document from OneDrive and then edit it

    I want my excel spreadsheet to be able to open a file that is saved on OneDrive, then add some information to the next available line, save and close. I think I could figure it out if I got help with opening the file that is saved on OneDrive. Does anyone know how to do that part?
    Last edited by manofcheese; 06-18-2014 at 09:23 PM.

  2. #2
    Valued Forum Contributor natefarm's Avatar
    Join Date
    04-22-2010
    Location
    Wichita, Kansas
    MS-Off Ver
    2016
    Posts
    1,020

    Re: Use VBA to open a document from OneDrive and then edit it

    I don't know what OneDrive is, but this should do it.

    Please Login or Register  to view this content.
    Acts 4:12
    Salvation is found in no one else, for there is no other name under heaven given to mankind by which we must be saved.

  3. #3
    Forum Contributor
    Join Date
    05-24-2014
    MS-Off Ver
    Microsoft Office 2013
    Posts
    113

    Re: Use VBA to open a document from OneDrive and then edit it

    OneDrive is Microsoft's cloud drive. The problem I am having is getting the file path since it is saved online.

  4. #4
    Forum Contributor
    Join Date
    05-24-2014
    MS-Off Ver
    Microsoft Office 2013
    Posts
    113

    Re: Use VBA to open a document from OneDrive and then edit it

    So I tried out your code with another filepath because I think I can get it to work with my needs but it comes up with an error halfway through running it. If I press ok then it works fine but is there a way I can have it press ok for me? Here is the picture. Error Message.PNG

  5. #5
    Forum Contributor
    Join Date
    05-24-2014
    MS-Off Ver
    Microsoft Office 2013
    Posts
    113

    Re: Use VBA to open a document from OneDrive and then edit it

    I just found out how. Here is your code with just a few changes. It works great
    Please Login or Register  to view this content.

  6. #6
    Forum Contributor
    Join Date
    05-24-2014
    MS-Off Ver
    Microsoft Office 2013
    Posts
    113

    Re: Use VBA to open a document from OneDrive and then edit it

    P.S. You can get the filepath if you download OneDrive for your computer. I ended up just using dropbox. I know I will have to change the filepath for each computer I put this on but I am okay with this solution.

  7. #7
    Valued Forum Contributor natefarm's Avatar
    Join Date
    04-22-2010
    Location
    Wichita, Kansas
    MS-Off Ver
    2016
    Posts
    1,020

    Re: Use VBA to open a document from OneDrive and then edit it

    Very good. FYI, if the last 2 lines in the subroutine were somewhere in the middle, they would serve a purpose. At the end, not really needed.

  8. #8
    Registered User
    Join Date
    02-18-2019
    Location
    Tampa, FL
    MS-Off Ver
    Office 365 - Office 2016
    Posts
    1

    Re: Use VBA to open a document from OneDrive and then edit it

    is it possible to open the onedrive file using a link instead of syncing the onedrive folder to your local machine?

  9. #9
    Administrator FDibbins's Avatar
    Join Date
    12-29-2011
    Location
    Duncansville, PA USA
    MS-Off Ver
    Excel 7/10/13/16/365 (PC ver 2310)
    Posts
    52,926

    Re: Use VBA to open a document from OneDrive and then edit it

    tamparay welcome to the forum

    Unfortunately your post does not comply with Rule 4 of our Forum RULES. Do not post a question in the thread of another member -- start your own thread.

    If you feel an existing thread is particularly relevant to your need, provide a link to the other thread in your new thread.

    Old threads are often only monitored by the original participants. New threads not only open you up to all possible participants again, they typically get faster response, too.
    1. Use code tags for VBA. [code] Your Code [/code] (or use the # button)
    2. If your question is resolved, mark it SOLVED using the thread tools
    3. Click on the star if you think someone helped you

    Regards
    Ford

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. open excel source document in background when i open word document
    By hootiebsc in forum Word Programming / VBA / Macros
    Replies: 5
    Last Post: 03-22-2013, 07:50 PM
  2. [SOLVED] scanned a document in to .xls format . How to open/edit?
    By Mll in forum Excel Formulas & Functions
    Replies: 0
    Last Post: 01-25-2006, 07:00 PM
  3. [SOLVED] Why can't I edit my excel document? Edit buttons shaded.
    By Arl @ CBC in forum Excel - New Users/Basics
    Replies: 0
    Last Post: 09-06-2005, 07:05 AM
  4. Why can't I edit my excel document? Edit buttons shaded.
    By Arl @ CBC in forum Excel - New Users/Basics
    Replies: 0
    Last Post: 09-06-2005, 03:05 AM
  5. [SOLVED] Why can't I edit my excel document? Edit buttons shaded.
    By Arl @ CBC in forum Excel - New Users/Basics
    Replies: 0
    Last Post: 09-06-2005, 01:05 AM

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1