Cannot close all instances of excel after calling excel workbook in Access Code  
Author Message
supermsd





PostPosted: Visual Basic for Applications (VBA), Cannot close all instances of excel after calling excel workbook in Access Code Top

Somehow, another instance of excel is loading when I refer to elements in my code. Such that when I ask for another display of the excel sheet the first global range is exceeded. You should probably see the code. If you want I can send it to you for comment. Is there an ABSOLUTE way of shutting down ALL instances of excel at the end of code execution

Thank you,

supermsd



Microsoft ISV Community Center Forums2  
 
 
Derek Smyth





PostPosted: Visual Basic for Applications (VBA), Cannot close all instances of excel after calling excel workbook in Access Code Top

You don't want to consider closing all instances of Excel as the user whose using your spreadsheet may have another instance of Excel open containing another spreadsheet they don't want to close.

You need to fix the problem of creating two instances of Excel in Access. You can send me the code if you like and I'll have a look at it. dsmyth at ntlworld dot com.



 
 
Suggestion





PostPosted: Visual Basic for Applications (VBA), Cannot close all instances of excel after calling excel workbook in Access Code Top

hi

i am also facing the same problem

actually i dont have problem if the user of the system will be end up with all the application stopped when i dispose my excel object

i just want to dispose my application's excel object.

one more thing i would like to mention

when i write something like

if (objExcel != null)
{
objExcel.Visible = false;
objExcel.Workbooks.Close();
objExcel = null;
}



the red line will ask me that "do u want to save the excel sheet or not "

and if i press Cancel button it gives that HRESULT error



Sincerely,