Hi @Adam Baker
Thanks so much for reaching out to the Microsoft Q&A Forum.
I understand you’re using a macro to check the username when the file opens and display only the required data, but that approach isn’t working when the file is opened in a browser.
Unfortunately, Excel Online doesn’t support VBA, so there’s currently no built-in way to detect the username or run any macros when the file is opened in the browser. Macros only work when the file is opened in the desktop version of Excel, so any logic based on user identity would need to happen there.
Based on what I’ve researched, there’s a setting you can try if your Excel file is stored in a SharePoint Online document library, it may help encourage the file to open in the desktop app:
- Go to the document library.
- Click the gear icon > Library settings.
- Select Advanced settings.
- Under “Opening Documents in the Browser”, choose “Open in the client application”.
- Save your changes.
In addition, I also tried changing the setting in Excel itself by going to:
- Go to Excel > File > Options.
- Advanced
- Open Word, Excel, and PowerPoint files using: Desktop app
I gave it a try myself, but unfortunately it hasn’t worked just yet, it’s possible the change needs a bit of time to take effect. I’ll monitor it and keep you posted if anything changes.
Feel free to give it a try on your end and let me know how it goes.
If the answer is helpful, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".
Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.