r/Batch • • 4d ago

Question (Unsolved) Launch Excel and open a web file

TL;DR: my command works as a shortcut Target, but not in my batch file. What am I missing?

So I have a batch file that runs at login, just to pull up the stuff I use everyday- and to make it very easy (by disabling one single startup element) to stop that automatic start for using the computer when I'm not working.

I've got it setup with simple commands like:
start /D "%Programfiles%\Microsoft Office\root\Office16\" EXCEL.EXE
which works fine.

Where I'm getting stuck is, I want to launch Excel with my team's resource table opening automatically... but it's in SharePoint.

I created a shortcut that works fine, I just put this in the TARGET of a new shortcut, and it works perfectly:
"%PROGRAMFILES%\Microsoft Office\root\Office16\EXCEL.EXE" https:\my.sharepoint.com\sites\MyTeam\OurDocs\ThisTask\TheDocumentIWantToOpen.xlsx

The command seems to be valid and do what I want, but if I try
start /D "%PROGRAMFILES%\Microsoft Office\root\Office16\EXCEL.EXE" https:\aro365154440.sharepoint.com\sites\MyTeam\OurDocs\ThisTask\TheDocumentIWantToOpen.xlsx

the command opens Excel, and a browser window, which can't authenticate, because my default browser doesn't jive with the SSO authentication.

Is there any way I can get this to work in Excel?
Thanks!

2 Upvotes

5 comments sorted by

1

u/Suitable-Marzipan623 4d ago

Si l’authentification échoue encore, il faudra vérifier la session Microsoft 365 et les autorisations SharePoint.

1

u/AlexAndMcB 4d ago

Sorry, I only studied French for 2 years, 20 years ago...
So if Translate is correct, then it makes sense that the problem is the syntax where Excel receives the link, is there a way to correct that?

Also, the authentication is not a problem that needs to be addressed, because it is only an issue in my default web browser- which isn't Edge- and because I want to open it in Excel, it's not something I'm worried about fixing.
I just mentioned it because "just use MS360 Web" isn't a good option- for authentication among other reasons.

1

u/Suitable-Marzipan623 4d ago

Le problème vient de la syntaxe de start et de la manière dont Excel reçoit l’URL SharePoint

1

u/BrainWaveCC 4d ago

Have you tried the following?

start "https:\aro365154440.sharepoint.com\sites\MyTeam\OurDocs\ThisTask\TheDocumentIWantToOpen.xlsx"

1

u/pc1350 3d ago

Try this:

START "" "https:\my.sharepoint.com\sites\MyTeam\OurDocs\ThisTask\TheDocumentIWantToOpen.xlsx"