Sign in to follow this  
Followers 0
TSprouse

_ExcelBookClose not ending Excel Process

5 posts in this topic

I'm running Win7 (Retail Ver) and Excel 2007

#include <Array.au3>
#include <Excel.au3>

$oExcel = _ExcelBookOpen("d:\temp\CADStations.xlsx",1)
$aryMachines = _ExcelReadSheetToArray($oExcel)
_ExcelBookClose($oExcel)

I've tried thesuggestions in this thread... http://www.autoitscript.com/forum/index.php?showtopic=99416&st=0&p=717149

But none of that seems to be working.

does anyone have any other thoughts?

- Travis

Share this post


Link to post
Share on other sites



$PID = ProcessExists("excel.exe")
ProcessClose($PID)

This may also work

$oExcel.Application.Quit

Share this post


Link to post
Share on other sites

#3 ·  Posted (edited)

$PID = ProcessExists("excel.exe")
ProcessClose($PID)

Getting the PID and using Process Close did Work, thank you.

Travis

Edited by TSprouse

Share this post


Link to post
Share on other sites

Old thread, I know, but I have a new addition / solution.

Windows 7 x64, Office 2010, latest AutoIt

Close process using PID did not work for me. If I open an Exccel file after that (using regular double click in Windows Explorer), I get a warning on the left side: Previous file... XLS did not close properly.

But, a simple solution is this - last 2 lines:

$ex01 = _ExcelBookOpen("file.xls", 0)
_ExcelBookClose($ex01, 0, 0)
$ex01 = ""

After that, exel.exe process is gone from memory in an instant.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0