Jump to content

Close the entire application of excel


Go to solution Solved by MikahS,

Recommended Posts

Posted

Then back to my question from post #18.

My UDFs and Tutorials:

Spoiler

UDFs:
Active Directory (NEW 2024-07-28 - Version 1.6.3.0) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example Scripts
OutlookEX (2021-11-16 - Version 1.7.0.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX_GUI (2021-04-13 - Version 1.4.0.0) - Download
Outlook Tools (2019-07-22 - Version 0.6.0.0) - Download - General Help & Support - Wiki
PowerPoint (2021-08-31 - Version 1.5.0.0) - Download - General Help & Support - Example Scripts - Wiki
Task Scheduler (2022-07-28 - Version 1.6.0.1) - Download - General Help & Support - Wiki

Standard UDFs:
Excel - Example Scripts - Wiki
Word - Wiki

Tutorials:
ADO - Wiki
WebDriver - Wiki

 

Posted (edited)

I justed tested wih Excel 2010 on Windows 7 64 bit. Works fine.

  • Is there anything special in the Excel workbook like macros etc?
  • Which version of AutoIt do you run?
  • Do you run the 32 or 64 bit version of Excel?
Edited by water

My UDFs and Tutorials:

Spoiler

UDFs:
Active Directory (NEW 2024-07-28 - Version 1.6.3.0) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example Scripts
OutlookEX (2021-11-16 - Version 1.7.0.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX_GUI (2021-04-13 - Version 1.4.0.0) - Download
Outlook Tools (2019-07-22 - Version 0.6.0.0) - Download - General Help & Support - Wiki
PowerPoint (2021-08-31 - Version 1.5.0.0) - Download - General Help & Support - Example Scripts - Wiki
Task Scheduler (2022-07-28 - Version 1.6.0.1) - Download - General Help & Support - Wiki

Standard UDFs:
Excel - Example Scripts - Wiki
Word - Wiki

Tutorials:
ADO - Wiki
WebDriver - Wiki

 

Posted (edited)

I justed tested wih Excel 2010 on Windows 7 64 bit. Works fine.

  • Is there anything special in the Excel workbook like macros etc?
  • Which version of AutoIt do you run?
  • Do you run the 32 or 64 bit version of Excel?

Hmm.. No, nothing special, even an empty workbook still has the same result.

AutoIt is latest: v3.3.14.1

Excel 2013 15.0.4737.1000 32-bit

Windows 7 64-bit

 

I've added some checks and my results are further down below

$aProcesses = ProcessList("Excel.exe")
    ConsoleWrite($aProcesses[0][0] & " Excel instance(s) running." & @CRLF)
    ConsoleWrite('Started Processing ' & $file & @CRLF)
    $oExcel = _Excel_Open(False, False, False, False, True)
    $oWorkbook = _Excel_BookOpen($oExcel, $file, True)
    $aOrgArray = _Excel_RangeRead($oWorkbook)
    $oWorkbook = _Excel_BookClose($oWorkbook, False)
    $oExcelClose = _Excel_Close($oExcel, False, True)
    Sleep(2000)
    ConsoleWrite('Finished Processing ' & $file & @CRLF)
    ConsoleWrite('$oExcelClose=' & $oExcelClose & '   |   @error=' & @error & '   |   @extended=' & @extended & @CRLF)
    $aProcesses = ProcessList("Excel.exe")
    ConsoleWrite($aProcesses[0][0] & " Excel instance(s) still running." & @CRLF)

Console result:

0 Excel instance(s) running.
Started Processing C:\Blank Workbook.xlsx
_Excel_Open() triggered
__Excel_CloseOnQuit triggered. $bNewState=True
_Excel_BookOpen() triggered
_Excel_BookClose() triggered
_Excel_Close() triggered. $bForceClose=True
__Excel_CloseOnQuit triggered. $bNewState=Default
__Excel_CloseOnQuit triggered. $bNewState=False
Finished Processing C:\Blank Workbook.xlsx
$oExcelClose=1   |   @error=0   |   @extended=0
1 Excel instance(s) still running.

 

I have also confirmed that this behaviour is unique to having a 32-bit version of Office on a 64-bit version of Windows. Another system that has both 64-bit OS and 64-bit Office appears to work fine. So it's a mixed software architecture issue. Any ideas on how to resolve?

Edited by mpower
Posted

Would it be possible to test this with AutoIt 3.3.12.0?

My UDFs and Tutorials:

Spoiler

UDFs:
Active Directory (NEW 2024-07-28 - Version 1.6.3.0) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example Scripts
OutlookEX (2021-11-16 - Version 1.7.0.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX_GUI (2021-04-13 - Version 1.4.0.0) - Download
Outlook Tools (2019-07-22 - Version 0.6.0.0) - Download - General Help & Support - Wiki
PowerPoint (2021-08-31 - Version 1.5.0.0) - Download - General Help & Support - Example Scripts - Wiki
Task Scheduler (2022-07-28 - Version 1.6.0.1) - Download - General Help & Support - Wiki

Standard UDFs:
Excel - Example Scripts - Wiki
Word - Wiki

Tutorials:
ADO - Wiki
WebDriver - Wiki

 

Posted (edited)

Would it be possible to test this with AutoIt 3.3.12.0?

Just tested with 3.3.12.0 and no change in behaviour. Excel.exe  still remains in Task Manager.

As a sanity check, add #RequireAdmin to script.

Tried with #RequireAdmin also - no change.

 

Edited by mpower
Posted

I forgot I had Excel installed. I tried it on version 3.3.12.0 and it closes fine for me whether I close the workbook or not, or whether I set $bForceClose to true or false.

Are you running 32-bit Office on 64-bit Windows though?

Posted

I forgot I had Excel installed. I tried it on version 3.3.12.0 and it closes fine for me whether I close the workbook or not, or whether I set $bForceClose to true or false.

You are talking about Excel 2013?

My UDFs and Tutorials:

Spoiler

UDFs:
Active Directory (NEW 2024-07-28 - Version 1.6.3.0) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example Scripts
OutlookEX (2021-11-16 - Version 1.7.0.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX_GUI (2021-04-13 - Version 1.4.0.0) - Download
Outlook Tools (2019-07-22 - Version 0.6.0.0) - Download - General Help & Support - Wiki
PowerPoint (2021-08-31 - Version 1.5.0.0) - Download - General Help & Support - Example Scripts - Wiki
Task Scheduler (2022-07-28 - Version 1.6.0.1) - Download - General Help & Support - Wiki

Standard UDFs:
Excel - Example Scripts - Wiki
Word - Wiki

Tutorials:
ADO - Wiki
WebDriver - Wiki

 

Posted

JohnOne,

would it be possible to test with 3.3.14.1?

My UDFs and Tutorials:

Spoiler

UDFs:
Active Directory (NEW 2024-07-28 - Version 1.6.3.0) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example Scripts
OutlookEX (2021-11-16 - Version 1.7.0.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX_GUI (2021-04-13 - Version 1.4.0.0) - Download
Outlook Tools (2019-07-22 - Version 0.6.0.0) - Download - General Help & Support - Wiki
PowerPoint (2021-08-31 - Version 1.5.0.0) - Download - General Help & Support - Example Scripts - Wiki
Task Scheduler (2022-07-28 - Version 1.6.0.1) - Download - General Help & Support - Wiki

Standard UDFs:
Excel - Example Scripts - Wiki
Word - Wiki

Tutorials:
ADO - Wiki
WebDriver - Wiki

 

Posted

Thanks a lot!
We will then know (hopefully) if the problem is Autoit or Excel related.

My UDFs and Tutorials:

Spoiler

UDFs:
Active Directory (NEW 2024-07-28 - Version 1.6.3.0) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example Scripts
OutlookEX (2021-11-16 - Version 1.7.0.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX_GUI (2021-04-13 - Version 1.4.0.0) - Download
Outlook Tools (2019-07-22 - Version 0.6.0.0) - Download - General Help & Support - Wiki
PowerPoint (2021-08-31 - Version 1.5.0.0) - Download - General Help & Support - Example Scripts - Wiki
Task Scheduler (2022-07-28 - Version 1.6.0.1) - Download - General Help & Support - Wiki

Standard UDFs:
Excel - Example Scripts - Wiki
Word - Wiki

Tutorials:
ADO - Wiki
WebDriver - Wiki

 

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
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...