+ Reply to Thread
Results 1 to 8 of 8

Share an excel file on onedrive/sharepoint with vba

  1. #1
    Valued Forum Contributor
    Join Date
    11-12-2014
    Location
    Nottingham
    MS-Off Ver
    2013
    Posts
    383

    Share an excel file on onedrive/sharepoint with vba

    Hi All,

    I am struggling to find the code necessary to do the following (if it actually exists). I would like to share a file (xlsx) that is on onedrive/sharepoint (desktop version) with a specific person i.e through email address. I know how to email a file as an attachment but I would prefer it to be a file saved on onedrive/sharepoint so that I can update it from my end constantly. I need to do this automatically as there are approximately 800 files needing to go to 800 different pupils.

    Many thanks in advance for your help.
    !If all your troubles are solved, then so is the thread. Show this by marking it so using thread tools at the top of the page.
    If I helped do this, then please show your appreciation by awarding rep points.
    <------ Button for that is over there

  2. #2
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2405 (Windows 11 23H2 64-bit)
    Posts
    81,397

    Re: Share an excel file on onedrive/sharepoint with vba

    Why not simply share the file from within the program? Use the Share button top right to generate a link. Adjust the settings if you want the co-workers to be able to edit the file, then E-mail them all the link. You could probably record a macro and then adapt the code to do this.
    Ali


    Enthusiastic self-taught user of MS Excel who's always learning!
    Don't forget to say "thank you" in your thread to anyone who has offered you help.
    You can reward them by clicking on * Add Reputation below their user name on the left, if you wish.

    Forum Rules (updated August 2023): please read them here.

  3. #3
    Valued Forum Contributor
    Join Date
    11-12-2014
    Location
    Nottingham
    MS-Off Ver
    2013
    Posts
    383
    Thanks for your reply! I would have to do this individually for all 800+ files as they are personal to each pupil. Unfortunately the record a macro does not record the sharing of the file.

  4. #4
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2405 (Windows 11 23H2 64-bit)
    Posts
    81,397

    Re: Share an excel file on onedrive/sharepoint with vba

    Ah, I see.

    Why not mail merge the data they need from the master file and just send them an E-mail with that? What is the ultimate purpose here?

    I am a teacher, too.

    Administrative Note:


    Please don't quote whole posts, especially when you are responding to the one immediately preceding your own - it's just clutter. It's OK to quote if you are responding to a post out of sequence, but limit quoted content to a few relevant lines that makes clear to whom and what you are responding. Thanks!

    For normal conversational replies, try using the QUICK REPLY box below.

  5. #5
    Valued Forum Contributor
    Join Date
    11-12-2014
    Location
    Nottingham
    MS-Off Ver
    2013
    Posts
    383

    Re: Share an excel file on onedrive/sharepoint with vba

    Since you are a teacher I imagine you will understand. My aim is to set up a personalised spreadsheet for each pupil with a topic list on that is RAG rated for that pupil, which in turn is automatically updated from my QLA (question level analysis) spreadsheets and that the pupil can view an up to date sheet at any point in time.

    P.s I did press the reply button under your post on my phone so I’m not sure what happened, sorry!

  6. #6
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2405 (Windows 11 23H2 64-bit)
    Posts
    81,397

    Re: Share an excel file on onedrive/sharepoint with vba

    Ah, I think it defaults to Reply With Quote on a phone - just delete the quote if it does.

    I presume each pupil's file has a name that is generic plus a unique identifier? If so, then you can parse a field using the generic portion of the file URL plus the unique ID and mail merge this as a link into each of the E-mails you send.

    You'll have to wait for a VBA expert with specific knowledge of Sharepoint to advise.

  7. #7
    Valued Forum Contributor
    Join Date
    11-12-2014
    Location
    Nottingham
    MS-Off Ver
    2013
    Posts
    383

    Re: Share an excel file on onedrive/sharepoint with vba

    Yes they do. Thank you for your help anyway!

  8. #8
    Registered User
    Join Date
    08-05-2020
    Location
    Stockholm. Sweden
    MS-Off Ver
    Office 365
    Posts
    1

    Re: Share an excel file on onedrive/sharepoint with vba

    Hi, did you ever get an answer to this question? Or figure out another way to do it? I have exactly the same issue: I want to create pupil-specific files that get shared to each pupil individually, so that I can update their files during the course of the year.

    Just emailing a link isn't enough - I want to set the OneDrive sharing permissions individually on each file, since I don't want to grant everyone access to the whole folder, just their own file.

    It's possible that VBA is not the right tool for this, but what are the alternatives?

    Regards

    ConorF

+ 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. Replies: 1
    Last Post: 03-12-2019, 04:32 PM
  2. Get Share Link from OneDrive files
    By TudyBTH in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 06-02-2017, 11:49 AM
  3. VBA to select SharePoint Content Type when saving Excel file to SharePoint
    By Luffk73 in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 05-24-2017, 05:22 PM
  4. [SOLVED] Auto Backup Excel File in OneDrive
    By LewisJ in forum Excel General
    Replies: 0
    Last Post: 03-31-2017, 10:49 AM
  5. Excel rollup macro works on file share but not in SharePoint document library
    By mscurtin67 in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 10-24-2013, 01:46 AM
  6. Replies: 0
    Last Post: 10-08-2013, 10:54 AM

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