I wanted to record this tip for histories sake. It's an issue I struggled with for years, but finally happened upon a discussion between Paul Mazaika and Dan Jinks occurring late September, 2001, at Codehound.com, which answered the issue I'd been experiencing all along.
Basically, I'm creating excel workbooks using VB and early binding, and on specific workbooks, when I go to close and set all objects to nothing, a hidden instance of Excel remained in memory, regardless of the API or getobject code I tried to close the instance. This would make it so VB could not create an instance of a new excel object, and force me to restart the application at each point it would mess up. I'm still not sure why it messed up.
The solution the two guys mentioned above arrived at, and that I'd like to share here, is to early bind the excel.application and excel.workbook object variables, but late bind the worksheet variable. Why this is effective is a question for those more experienced than myself, but it's working to correct the issue I was having, and now I can find myself another issue to chew on...
I hope this helps someone out there,
Drew Bell
Basically, I'm creating excel workbooks using VB and early binding, and on specific workbooks, when I go to close and set all objects to nothing, a hidden instance of Excel remained in memory, regardless of the API or getobject code I tried to close the instance. This would make it so VB could not create an instance of a new excel object, and force me to restart the application at each point it would mess up. I'm still not sure why it messed up.
The solution the two guys mentioned above arrived at, and that I'd like to share here, is to early bind the excel.application and excel.workbook object variables, but late bind the worksheet variable. Why this is effective is a question for those more experienced than myself, but it's working to correct the issue I was having, and now I can find myself another issue to chew on...
I hope this helps someone out there,
Drew Bell