+ Reply to Thread
Results 1 to 4 of 4

Does a source workbook in SharePoint need to be open in this case?

  1. #1
    Forum Contributor
    Join Date
    04-03-2009
    Location
    Anchorage, Alaska, USA
    MS-Off Ver
    Office 365
    Posts
    113

    Does a source workbook in SharePoint need to be open in this case?

    Hi,

    Does a workbook stored in SharePoint need to be open in order to pull data from it using WITH(workbook path + name) ? I know it does not need to be open when using formulas - but what about VBA?

    A little backstory: A benefit of OneDrive/SharePoint is that when working with formulas, the OD/SP reference workbook does not need to be open to pull data. That's huge to me - it makes things so much easier vs. opening every workbook in order to reference it when they're on a local/network drive. For example, in order to reference cells A1 and A2 in a workbook in D:folder/folder - that workbook needs to be open to grab the data. And if you need 5 workbooks in order to do that thing you want to do, then they all need to be open to grab the data. If they're not, you get error, error, error all over the place. What a silly pain in the butt.

    I didn't expect it, but I found if the workbooks you need to reference are in SharePoint, they can remain closed - you just got to reference them in formula like: =SUM('https://abcde.sharepoint.com/folder/folder/folder/[WorkbookName.xlsx]SheetName'!$A$1:$A$2) to get the sum of A1 and A2. The ABCDE by the way is the name of your account/company/etc.

    Ok, so like I said, I LOVE this feature. No longer a need to deal with REF and VALUE errors and crap.

    But I'm running into trouble when I'm trying to do this with VBA macros. Referencing another workbook is done with the WITH command, and I'm getting errors: WITH(path/workbook.sheet....yadda yadda.... works great in a local/network setting. But I'm not able to get that to work with a CLOSED workbook that's on SharePoint. I'm not finding a lot on the internet, and I'm finding that sometimes there's some URL-to-path translation that needs to happen. So, I'm slowly figuring it out, but does anyone have some experience with this?

  2. #2
    Forum Expert rorya's Avatar
    Join Date
    08-13-2008
    Location
    East Sussex, UK
    MS-Off Ver
    365 Ent Monthly Channel / Insiders Beta
    Posts
    8,918

    Re: Does a source workbook in SharePoint need to be open in this case?

    With has nothing to do with referencing workbooks. It just holds a reference to any object. You cannot have a Workbook object in VBA unless it is open. Equally, you can only have a Range object if its workbook is open.
    Rory

  3. #3
    Forum Contributor
    Join Date
    04-03-2009
    Location
    Anchorage, Alaska, USA
    MS-Off Ver
    Office 365
    Posts
    113

    Re: Does a source workbook in SharePoint need to be open in this case?

    Ugh - why cant VBA by easy? That puts a dent in things. I'll need to do an intermediary step to pull data from a closed workbook in SharePoint into a macro then.

    Well that's ok. I can apply formulas via my macro to pull data from closed SharePoint workbooks into a helper sheet, then pull those cell values into the macro, and continue.

    Yeah - that'll work just fine with closed workbooks.

    Thanks!

  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. 2404 (Windows 11 22H2 64-bit)
    Posts
    80,998

    Re: Does a source workbook in SharePoint need to be open in this case?

    If that takes care of your original question, please choose Thread Tools from the menu link above and mark this thread as SOLVED. You can also access the SOLVED tag by editing the opening post and choosing SOLVED from the drop-down to the left of the title box.

    Also, if you have not already done so, remember that you can reward anyone who offered you help towards a solution for your issue by clicking the small star icon (* Add Reputation) located in the lower left corner of the post in which the help was given. By doing so you can add to the reputation(s) of each of those who offered help.
    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.

+ 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: 0
    Last Post: 09-07-2021, 02:13 PM
  2. Replies: 2
    Last Post: 03-18-2017, 02:05 AM
  3. [SOLVED] SUMPRODUCT returns #REF! unless source workbook is open
    By cangokturk in forum Excel Formulas & Functions
    Replies: 7
    Last Post: 11-27-2016, 10:24 AM
  4. Link not working when source workbook is open
    By Renoix in forum Excel General
    Replies: 6
    Last Post: 03-09-2016, 04:43 PM
  5. Does linking always try to open the source workbook?
    By brucemc777 in forum Excel General
    Replies: 2
    Last Post: 03-15-2014, 10:35 PM
  6. Update workbook without open XML source file
    By vietdieu in forum Excel General
    Replies: 0
    Last Post: 01-24-2012, 11:39 AM
  7. need to link without having source workbook open
    By adbowe in forum Excel Formulas & Functions
    Replies: 0
    Last Post: 08-18-2006, 07:45 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