Forum Discussion
mugheessiddiqui
13 years agoContributor
I'm also working with Excel via COM but never faced locking issue. I've used following lines of code before working with Excel File, may be it will help you.
excel = Sys.WaitProcess('EXCEL');
if(excel.Exists)
excel.Terminate();
try
{
MsExcel = Sys.OleObject("Excel.Application");
}
catch(exception)
{
Log.Warning("Unable to initialize MS Excel.", "", pmHigher);
return;
}
// rest of the code opening workbook and visible excel here.