try { //Check and see if the user closed the workbook frmFoodPantry.objApp.Workbooks.get_Item(RegGlobals.excelFileName); } // If the work book was not open then open the workbook, then open the requeste form. catch { // The user did close the workbook so reopen it frmFoodPantry.theWorkbook = frmFoodPantry.objApp.Workbooks.Open(RegGlobals.StrPath); }
RegGlobals.excelFileName
frmFoodPantry.objApp.Workbooks.get_Item(...)
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)