+ Reply to Thread
Results 1 to 4 of 4

VBA: Show pop-up when Excel file is opened in browser (e.g. SharePoint / OneDrive)

  1. #1
    Forum Contributor
    Join Date
    08-25-2015
    Location
    London
    MS-Off Ver
    MS 365
    Posts
    213

    Question VBA: Show pop-up when Excel file is opened in browser (e.g. SharePoint / OneDrive)

    Hi all,

    I'm using an Excel file at work that has a lot of macros in it (e.g. to automatically copy content from a to b). Those macros do not work if the file is opened in browser, e.g. via a sharepoint / onedrive link that was shared.
    So far, I've always added big fat red letters on every spreadsheet that the file needs to be opened locally, i.e. in client, for it to work properly.
    Sadly, this is often ignored so colleagues add content to the spreadsheet, but the macros cannot execute so the file is basically useless from that point.

    Is there any way to show a pop-up to remind colleagues to open in client, when the file is opened in browser?
    Is there VBA code that can still execute in browser?

    I found the following in another forum and it's supposed to tell if the file is read-only or not if opened on sharepoint. Thought maybe this can be tweaked somehow?

    Please Login or Register  to view this content.
    Any help is appreciated!
    Thank you!

  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,908

    Re: VBA: Show pop-up when Excel file is opened in browser (e.g. SharePoint / OneDrive)

    You can't run VBA in a browser, no. So any VBA approach is doomed, I'm afraid.
    Rory

  3. #3
    Forum Guru
    Join Date
    07-25-2011
    Location
    Florida
    MS-Off Ver
    Excel 2003
    Posts
    9,643

    Re: VBA: Show pop-up when Excel file is opened in browser (e.g. SharePoint / OneDrive)

    One thought is to do it backwards in a sense. Have a WorkbooK_Open macro unprotect the worksheets and a Workbook_Close macro protect the sheets. This will only run when the workbook is opened locally.

    Have a Worksheet with a big warning message and protect all the other sheets from edits. Then have the Workbook_Open macro to enable the workbook where it hides the warning sheet and unprotects the others. Then have a Workbook_Close macro unhide the warning sheet and protect the others.
    Surround your VBA code with CODE tags e.g.;
    [CODE]your VBA code here[/CODE]
    The # button in the forum editor will apply CODE tags around your selected text.

  4. #4
    Forum Contributor
    Join Date
    08-25-2015
    Location
    London
    MS-Off Ver
    MS 365
    Posts
    213

    Re: VBA: Show pop-up when Excel file is opened in browser (e.g. SharePoint / OneDrive)

    Hi rorya & AlphaFrog,

    Makes sense...thought so :-(

    But I like your suggestion, AlphaFrog! Haven't thought about this! Will give it a try!! Thank you!

+ 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: 03-23-2021, 05:04 PM
  2. VBA Code for File Location on OneDrive/SharePoint
    By Vinod Krishna.C in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 01-05-2021, 12:50 PM
  3. Share an excel file on onedrive/sharepoint with vba
    By ARowbot in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 08-05-2020, 08:29 PM
  4. Excel formula referencing another Excel workbook on Sharepoint/Onedrive
    By Renoux in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 08-05-2019, 08:05 AM
  5. [SOLVED] Opening an Excel worksheet from OneDrive on a Network (SharePoint)
    By Frankie_The_Flyer in forum Excel Programming / VBA / Macros
    Replies: 8
    Last Post: 07-13-2019, 03:12 AM
  6. When Excel files can be opened in browser?
    By abbassi in forum Excel General
    Replies: 0
    Last Post: 06-26-2014, 04:56 AM
  7. Excel cannot open while web browser opened
    By soundbug in forum Excel General
    Replies: 0
    Last Post: 04-27-2006, 01:25 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