Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

win32ole processes still running #11

Open
mazimi opened this issue Feb 27, 2014 · 4 comments
Open

win32ole processes still running #11

mazimi opened this issue Feb 27, 2014 · 4 comments

Comments

@mazimi
Copy link

mazimi commented Feb 27, 2014

I've noticed that when using win32ole to access Excel, I still have "EXCEL.EXE" processes showing in Windows Task Manager. It seems that xl.Quit(); doesn't actually close the application. Here is an example of what I'm doing:

var xl = win32ole.client.Dispatch('Excel.Application');
xl.Visible = false;
xl.DisplayAlerts = false;
xl.ScreenUpdating = false;
xl.EnableEvents = false;
var book = xl.Workbooks.Open(filename);
book.Saved = true;
xl.Workbooks.Close();
xl.Quit();

I've tried forcing garbage collection as well with no change in behavior. Also, after two cycles of opening and closing the excel workbook, I get the following error on the third and all subsequent attempts:

OLE error: [Open] -2147352570 [Open] IDispatch::GetIDsOfNames AutoWrap() failed
@Antony74
Copy link
Contributor

Oh dear, I'm afraid this works for me, so I have been unable to reproduce your problem :-(

var win32ole = require('win32ole');

var xl = win32ole.client.Dispatch('Excel.Application');
xl.Visible = false;
xl.DisplayAlerts = false;
xl.ScreenUpdating = false;
xl.EnableEvents = false;
var book = xl.Workbooks.Open("c:\\temp\\Worksheet.xlsx");
book.Saved = true;
xl.Workbooks.Close();
xl.Quit();

No stray instances of EXCEL.exe lurking around.

@nobuhito
Copy link

I was reproduced with the following code:

var win32ole = require('win32ole');
console.log(win32ole.version());
var xl = win32ole.client.Dispatch('Excel.Application');
xl.Visible = false;
xl.DisplayAlerts = false;
xl.ScreenUpdating = false;
xl.EnableEvents = false;
var files = ["c:\\test.xls", "c:\\test.xls", "c:\\test.xls"];
for (var i=0; i<files.length; i++) {
    console.log(files[i]);
    var book = xl.Workbooks.Open(files[i]);
    book.Saved = true;
    xl.Workbooks.Close();
}
xl.Quit();

result

0.1.3
c:\test.xls
c:\test.xls
c:\test.xls
OLE error: [Open] -2147352570 [Open] IDispatch::GetIDsOfNames AutoWrap() failed


TypeError: node_win32ole::V8Variant::OLEInvoke failed
    at Object.<anonymous> (C:\Users\H1694\Desktop\wmi\lib\xls\test.js:11:33)
    at Module._compile (module.js:456:26)
    at Object.Module._extensions..js (module.js:474:10)
    at Module.load (module.js:356:32)
    at Function.Module._load (module.js:312:12)
    at Function.Module.runMain (module.js:497:10)
    at startup (node.js:119:16)
    at node.js:902:3

node -v
v0.10.25

@Sean-2007
Copy link

OLE error: [ocrVcodeInit] -2147352567 [ocrVcodeInit] = [1610809344] (It always s
eems to be appeared at that time you mistake calling 'obj.get { ocv->getProp() }
' <-> 'obj.call { ocv->invoke() }'.) IDispatch::Invoke AutoWrap() failed

TypeError: node_win32ole::V8Variant::OLEInvoke failed

hi ,i have this problem . but the component seem work well in the same PC, but simple other code .is there anybody who know the problem .
node -v
v0.10.26

@rich7ard
Copy link

rich7ard commented Jan 9, 2016

Anyone solved the errors yet ? Been getting the similar error.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants