ShellEx的:启动Excel的最小化或隐藏 [英] ShellEx: Starting Excel minimized or hidden

查看:734
本文介绍了ShellEx的:启动Excel的最小化或隐藏的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

使用下面的代码,我可以从C#中运行Excel:

Using the following code I can run Excel from within C#:

System.Diagnostics.Process p = new System.Diagnostics.Process();
p.StartInfo.FileName = "cmd.exe";
p.Start();



我可以做的Excel启动隐藏或最小化使用任何命令行参数?

Can I make Excel start hidden or minimized using any command line parameters?

(编辑:尝试 p.StartInfo.WindowStyle 键,它没有任何效果)

( Tried p.StartInfo.WindowStyle and it had no effect.)

我要开始Excel中的不使用COM ,因为在COM启动Excel的时候,无该XLA的插件加载

I need to start Excel without using COM because when starting Excel over COM, none of the XLA add-ins are loaded.

推荐答案

您可以设置的 WindowStyle 属性最小化隐藏。如下所示:

You can set the WindowStyle property to Minimized or Hidden. Like the following:

ProcessStartInfo p = new ProcessStartInfo("excel.exe");
p.WindowStyle = ProcessWindowStyle.Minimized;
Process.Start(p);

这篇关于ShellEx的:启动Excel的最小化或隐藏的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆