Hi all.
I am having issues with people not closing an important file in excel.
I have a new vb.net based application that i want to close the excel file when i prompt it to. The application checks for specific named files in a hidden folder on a timer event, (that all works fine) how do i tell it to close a file that is already open.
All threads i have read say things like this:
Dim XLApp As New Application
Dim WkBook As Workbook = XLApp.Workbooks.Open("C:\Book1.xls")
Dim Sheet As Worksheet = CType(WkBook.Sheets(1), Worksheet)
the above types of code always seem to create the file - this will easily allow you to then reference and close it, however i need my vb.net application to check if the user has the file open and then call a sub within that file to close it or simply close the file from my application.
In short i need a piece of vb.net code to check if this pc has excel running book1.xls and if it does to close book1.xls leaving the excel application window alone.
is this possible ????