public static bool IsDocExist(string name = "TOC") { if (!Documents.ContainsKey(name)) return false; Document doc = Documents[name]; if (doc.FileDirectory.Contains("#")) // #Template substitute with Path in Dictionary doc.FileDirectory = Templates[doc.FileDirectory]; if( !FileOp.isFileExist(doc.FileDirectory, doc.FileName) ) return false; if (!doc.isOpen) getDoc(name, fatal: false); if (!FileOp.isSheetExist(doc.Wb, doc.SheetN)) return false; return true; }