G
Guest
I have a VB.net assembly that manipulates excel data. At the end of data
processing, the user has the option to view the spreadsheet, which is at that
time open and not visible. So at this point it's a simple matter of saying
ObjXL.Visible, which works. However, I need to also test to see if the user
has viewed the workbook already and closed it, and then needs to open it
again. My code should test for the state of the Excel.Application as follows:
If ObjXL is still open then
ObjXL.Visible
Else
Re-open workbook using the last path saved
End if
Problem is, I have searched but cannot find a way to test if Excel is
running and, if not, to reload the workbook. I tried Is Nothing but if the
user closes Excel the ObjXL reference is never set to Nothing and persists.
processing, the user has the option to view the spreadsheet, which is at that
time open and not visible. So at this point it's a simple matter of saying
ObjXL.Visible, which works. However, I need to also test to see if the user
has viewed the workbook already and closed it, and then needs to open it
again. My code should test for the state of the Excel.Application as follows:
If ObjXL is still open then
ObjXL.Visible
Else
Re-open workbook using the last path saved
End if
Problem is, I have searched but cannot find a way to test if Excel is
running and, if not, to reload the workbook. I tried Is Nothing but if the
user closes Excel the ObjXL reference is never set to Nothing and persists.