Jump to content

Hanging process EXCEL.EXE


 Share

Recommended Posts

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

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

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

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

#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 by Scriptonize

If you learn from It, it's not a mistake

Link to comment
Share on other sites

#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 by guiAI

guiAI

Link to comment
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
 Share

  • Recently Browsing   0 members

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