Click here to Skip to main content
15,920,704 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
when i was coding in visual basic 2008, and a excel file started, it came the size i had left it the last time i used it..... know with Visual Studio 2020, it comes up full screen all the time...... i am using the 365 office

if i launch the same excel program from a desktop short cut it comes up like it should.

What I have tried:

Process.Start("C:\a_home\test.xlsm",)
Posted
Updated 3-Mar-22 7:37am
Comments
Richard MacCutchan 25-Feb-22 10:45am    
Check your StartInfo settings.

Try this:

C#
Process.Start("Excel.exe");

or
C#
Process.Start("Excel.exe", @"C:\a_home\test.xlsm");


This should do the job.
 
Share this answer
 
C#
ProcessStartInfo psi = new ProcessStartInfo();
psi.FileName = "excel.exe";
psi.Arguments = "myfile.xlsx";
psi.WindowStyle = ProcessWindowStyle.Normal;
Process.Start(psi);


should do it, but Google seems to tell me there are some sizing problems with Excel...

ADDED:
On my Win10 PC, Excel365 always opens a file the same way the last Excel session was terminated (on whatever file), so if you close Excel when its document was maximized, the next document you open with Excel will be shown maximized no matter what.
 
Share this answer
 
v6

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900