guiAI Posted August 3, 2009 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
somdcomputerguy Posted August 3, 2009 Posted August 3, 2009 WinCloseWinKill - Bruce /*somdcomputerguy */ If you change the way you look at things, the things you look at change.
DCCD Posted August 3, 2009 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
guiAI Posted August 3, 2009 Author 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
reb Posted August 10, 2009 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
SandelPerieanu Posted August 10, 2009 Posted August 10, 2009 OR DllCall("User32.dll", "int", "EndTask", "hwnd", WinGetHandle("EXCEL"), "int", 0, "int", 1)
guiAI Posted August 13, 2009 Author 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
Juvigy Posted August 14, 2009 Posted August 14, 2009 That is because you just close the wbook and not excel. Put one $oExcel.Quit before the msgbox.
guiAI Posted August 14, 2009 Author 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
Juvigy Posted August 14, 2009 Posted August 14, 2009 Try this one.It works for me: $oExcel.Application.Quit $oExcel=""
Scriptonize Posted August 14, 2009 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
guiAI Posted August 14, 2009 Author 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
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