Warning: file_get_contents(/data/phpspider/zhask/data//catemap/5/excel/25.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
使用VBS打开Excel并放置在窗口顶部_Excel_Vbscript - Fatal编程技术网

使用VBS打开Excel并放置在窗口顶部

使用VBS打开Excel并放置在窗口顶部,excel,vbscript,Excel,Vbscript,我目前正在使用下面的脚本打开Excel。脚本按照它的设想运行,但我需要它将excel放在所有窗口的顶部。目前,我在excel项目中有一个脚本,用于将userforms放置在所有窗口的顶部,但当我到达项目中的某个点时,它会导致excel崩溃,因此我将其精确定位到excel项目中的脚本中。以下是我用来打开excel文件的脚本: Dim AppExcel Set AppExcel = CreateObject("Excel.application") AppExcel.Workbooks.Open

我目前正在使用下面的脚本打开Excel。脚本按照它的设想运行,但我需要它将excel放在所有窗口的顶部。目前,我在excel项目中有一个脚本,用于将userforms放置在所有窗口的顶部,但当我到达项目中的某个点时,它会导致excel崩溃,因此我将其精确定位到excel项目中的脚本中。以下是我用来打开excel文件的脚本:

Dim AppExcel 
Set AppExcel = CreateObject("Excel.application") 
AppExcel.Workbooks.Open "C:\Users\****\Desktop\ App Tool\App.xlsm"
AppExcel.Visible = False

基于注释最小化每个打开的窗口,然后打开Excel

Set shell = wscript.CreateObject("Shell.Application")
Shell.MinimizeAll ''Comment me if you don't want to minimize everything

'Then rest of your code
Dim AppExcel 
Set AppExcel = CreateObject("Excel.application") 
AppExcel.Workbooks.Open "C:\Users\****\Desktop\ App Tool\App.xlsm"
AppExcel.Visible = True

'And in the end Release the Shell object
Set shell = Nothing

其他选择是最小化除Excel以外的所有程序?您能提供一个例子来最小化所有其他程序吗?欢迎您,如果有帮助,请联系我们。