Can Microsoft 365 Web Apps Open Local Office Files via Command Line?
Question details
The user wants to open local Word, Excel, and PowerPoint documents on macOS or Linux by passing a command-line parameter to Microsoft 365 Progressive Web Apps (PWAs) in Edge.

- Product
- Microsoft 365 Web Apps
- Device & OS
- macOS, Linux
- Scenario
- Attempting to launch local Office documents directly into a web-based Microsoft 365 application via a terminal command or script.
- Observed behavior
- Microsoft 365 web apps and browser PWAs cannot open local files through URL parameters because modern browser security models restrict direct access to local file systems.
Ensure you have an active Microsoft account with OneDrive or SharePoint set up, as web-based applications require files to be hosted in the cloud to bypass local browser security restrictions.
Upload to OneDrive or SharePoint First
Since browsers block direct command-line access to local files for web apps, uploading the document to Microsoft's cloud storage is the standard workaround.
Web browsers implement strict sandboxing to prevent malicious websites from reading your local hard drive. Consequently, passing a local file path as a URL parameter to a web app like Microsoft 365 will not work. The file must first exist in the cloud ecosystem.
Open your browser and navigate to OneDrive or SharePoint.
Drag and drop the local Word, Excel, or PowerPoint file into the browser window to upload it.
Click on the uploaded file to open it in the Microsoft 365 web application.

Automate Upload and Launch Using a Local Script
For users who require command-line functionality, a custom script can automate uploading the file and opening the resulting cloud URL.
Use the Built-in Web App File Picker
Instead of using the command line, you can manually select the file directly within the Microsoft 365 interface.
Easily Open Local Office Files from the Command Line with WPS Office
Avoid browser security restrictions and complex scripting workarounds. WPS Office is a free, lightweight desktop suite available for macOS and Linux that opens local Word, Excel, and PowerPoint files natively from your file manager or terminal.
- 1. Download the software: Visit the official WPS Office website and download the installation package for macOS or Linux.
- 2. Install the application: Follow the standard installation process for your operating system to install the WPS Office desktop suite.
- 3. Open files directly: Use your system terminal to open files directly, for example using 'wps /path/to/file.docx' on Linux, bypassing all web browser limitations.

Frequently Asked Questions
Why do browsers block Microsoft 365 web apps from opening local files?
Modern web browsers implement strict security sandboxing to prevent malicious websites from reading local system files without explicit user interaction, such as using a file picker dialog.
Can I use Edge command-line flags to bypass this security?
While browsers have developer flags to modify security settings, this approach is highly discouraged as it compromises your system's safety and is often ineffective for Progressive Web Apps (PWAs) integrated with cloud services.
Does the desktop version of Microsoft 365 have this limitation?
No. The fully installed desktop applications of Microsoft 365 for Windows and macOS have native file system access and can easily open local files via the command line or by double-clicking.
How can I open local Office files directly on Linux without using web apps?
You can install native Linux Office alternatives, such as WPS Office, which fully support command-line integration, direct local file access, and Microsoft Office file formats without requiring an internet connection.




