guiAI Posted August 3, 2009 Share Posted August 3, 2009 (edited) Can't find any effective solution in the forum, except: ProcessClose("excel.exe") Any idea? Thanks. Edited August 14, 2009 by guiAI guiAI Link to comment Share on other sites More sharing options...
somdcomputerguy Posted August 3, 2009 Share Posted August 3, 2009 WinCloseWinKill - Bruce /*somdcomputerguy */ If you change the way you look at things, the things you look at change. Link to comment Share on other sites More sharing options...
DCCD Posted August 3, 2009 Share Posted August 3, 2009 Can't find any effective solution in the forum, except: ProcessClose("excel.exe") Any idea? Thanks. Huh? [u][font=Arial Black]M[/font]y Blog, AVSS Parts[/u][font=Arial Black]Else[/font][font=Arial Black]L[/font]ibya Linux Users Group Link to comment Share on other sites More sharing options...
guiAI Posted August 3, 2009 Author Share Posted August 3, 2009 A little example: #include <Excel.au3> $oExcel = _ExcelBookNew(0) _ExcelWriteCell($oExcel, "Some text", 3, 2) _ExcelBookSaveAs($oExcel, @DesktopDir & "\Test.xls", "xls", 0, 1) _ExcelBookClose($oExcel) MsgBox(0, "Before exiting...", "Please, check process excel.exe in Task Manager") Until the Exit, process is hanging. guiAI Link to comment Share on other sites More sharing options...
reb Posted August 10, 2009 Share Posted August 10, 2009 A little example: #include <Excel.au3> $oExcel = _ExcelBookNew(0) _ExcelWriteCell($oExcel, "Some text", 3, 2) _ExcelBookSaveAs($oExcel, @DesktopDir & "\Test.xls", "xls", 0, 1) _ExcelBookClose($oExcel) MsgBox(0, "Before exiting...", "Please, check process excel.exe in Task Manager") Until the Exit, process is hanging. This works #include <Excel.au3> $oExcel = _ExcelBookNew(0) _ExcelWriteCell($oExcel, "Some text", 3, 2) _ExcelBookSaveAs($oExcel, @DesktopDir & "\Test", "xls", 0, 1) _ExcelBookClose($oExcel) MsgBox(0, "Before exiting...", "Please, check process excel.exe in Task Manager") REB MEASURE TWICE - CUT ONCE Link to comment Share on other sites More sharing options...
SandelPerieanu Posted August 10, 2009 Share Posted August 10, 2009 OR DllCall("User32.dll", "int", "EndTask", "hwnd", WinGetHandle("EXCEL"), "int", 0, "int", 1) Link to comment Share on other sites More sharing options...
guiAI Posted August 13, 2009 Author Share Posted August 13, 2009 This works#include <Excel.au3> $oExcel = _ExcelBookNew(0) _ExcelWriteCell($oExcel, "Some text", 3, 2) _ExcelBookSaveAs($oExcel, @DesktopDir & "\Test", "xls", 0, 1) _ExcelBookClose($oExcel) MsgBox(0, "Before exiting...", "Please, check process excel.exe in Task Manager")This does not work for me: process EXCEL.EXE still running when MsgBox appears. guiAI Link to comment Share on other sites More sharing options...
Juvigy Posted August 14, 2009 Share Posted August 14, 2009 That is because you just close the wbook and not excel. Put one $oExcel.Quit before the msgbox. Link to comment Share on other sites More sharing options...
guiAI Posted August 14, 2009 Author Share Posted August 14, 2009 That is because you just close the wbook and not excel. Put one $oExcel.Quit before the msgbox. Unfortunately your suggestion does not work for me (Excel 2007). Trying: #include <Excel.au3> $oExcel = _ExcelBookNew(0) _ExcelWriteCell($oExcel, "Some text", 3, 2) _ExcelBookSaveAs($oExcel, @DesktopDir & "\Test", "xls", 0, 1) _ExcelBookClose($oExcel) $oExcel.Quit MsgBox(0, "Before exiting...", "Please, check process excel.exe in Task Manager") process EXCEL.EXE is still running when MsgBox appears. guiAI Link to comment Share on other sites More sharing options...
Juvigy Posted August 14, 2009 Share Posted August 14, 2009 Try this one.It works for me: $oExcel.Application.Quit $oExcel="" Link to comment Share on other sites More sharing options...
Scriptonize Posted August 14, 2009 Share Posted August 14, 2009 (edited) #include <Excel.au3> $oExcel = _ExcelBookNew(0) _ExcelWriteCell($oExcel, "Some text", 3, 2) _ExcelBookSaveAs($oExcel, @DesktopDir & "\Test", "xls", 0, 1) _ExcelBookClose($oExcel) $oExcel.Quit MsgBox(0, "Before exiting...", "Please, check process excel.exe in Task Manager") I'v tested the code with excel 2003 running on windows xp-sp3. It works! >_< [[EDIT; added tested code ]] Edited August 14, 2009 by Scriptonize If you learn from It, it's not a mistake Link to comment Share on other sites More sharing options...
guiAI Posted August 14, 2009 Author Share Posted August 14, 2009 (edited) #include <Excel.au3> $oExcel = _ExcelBookNew(0) _ExcelWriteCell($oExcel, "Some text", 3, 2) _ExcelBookSaveAs($oExcel, @DesktopDir & "\Test", "xls", 0, 1) _ExcelBookClose($oExcel) $oExcel = "" MsgBox(0, "Before exiting...", "Please, check process excel.exe in Task Manager") SOLVED. Thanks Juvigy. Edited August 15, 2009 by guiAI guiAI Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now