Start Excel O365 using Process.Start launches it in protected view

Add-in Express™ Support Service
That's what is more important than anything else

Start Excel O365 using Process.Start launches it in protected view
 
nwein




Posts: 566
Joined: 2011-03-28
I know this is not an Add-In express specific issue, but i've just encountered this behaviour and i'm not sure what to do against it.
If I run the following code

var startInfo = new ProcessStartInfo("EXCEL.EXE", ""my file.xlsx"")
{
	WindowStyle      = ProcessWindowStyle.Normal,
	WorkingDirectory = Environment.CurrentDirectory
};
Process.Start(startInfo);

And my Excel protected view setting have the 'Enable Protected View for files originating from the Internet' option checked, then running the above code will launch Excel in protected mode.
This was never the case with Excel 2016 (and prior versions) but now that i've upgraded to Excel 2016 O365 (MSO 16.0.12527.20880, 64-bit Version 2002 Build 12527.20880 Click-to-Run) I get this behaviour.
Do you know how it can be circumvented?

Addendum:
In fact, this behvaiour happens when launching excel from a command line (i.e. no code is needed). Just open command line (even with administrator level) and call Excel with a file name.
Posted 31 Jul, 2020 11:37:34 Top
Andrei Smolin


Add-in Express team


Posts: 17306
Joined: 2006-05-11
Hello Nir,

For me, this only occurs if I open a file downloaded from the Internet. This doesn't occur if I open a file I created earlier.

Regards from Belarus (GMT+3),

Andrei Smolin
Add-in Express Team Leader
Posted 03 Aug, 2020 03:17:36 Top
nwein




Posts: 566
Joined: 2011-03-28
Thanks for looking into this.
I think I found a way to make it work: if I specify the full path of the Excel file then it works fine. If I use relative paths or try to open a file in the current directory, it then opens it up in in protected mode.
Very odd, and it definitely didn't happen in previous versions of Excel, but at least I got it to work now.

Thanks again!
Posted 04 Aug, 2020 13:06:48 Top
Andrei Smolin


Add-in Express team


Posts: 17306
Joined: 2006-05-11
You are always welcome!

Regards from Belarus (GMT+3),

Andrei Smolin
Add-in Express Team Leader
Posted 05 Aug, 2020 03:20:28 Top