/// <summary> /// 方法名称: OpenCreate /// 内容描述: 写文件时,用于文件创建及打开 /// 实现流程: /// 作 者: 林付国 /// 日 期: 2006-5-19 10:29:41 /// </summary> /// <returns></returns> public bool OpenCreate() { string strPath = ""; bool bolRet = false; strPath = this.FilePath; try { this.FileExteCheck(strPath); //如果文件不存在,则创建文件 if (!File.Exists(strPath)) { las.foundation.SmartExcel.SmartExcel excelObj = new las.foundation.SmartExcel.SmartExcel(); excelObj.CreateFile(strPath); excelObj.PrintGridLines = false; excelObj.CloseFile(); } bolRet = this.Open(); } catch { bolRet = false; throw new Exception("创建Excel出现错误,请检查!"); } return(bolRet); }
/// <summary> /// 方法名称: OpenCreate /// 内容描述: 写文件时,用于文件创建及打开 /// 实现流程: /// 作 者: 林付国 /// 日 期: 2006-5-19 10:29:41 /// </summary> /// <returns></returns> public bool OpenCreate() { string strPath = ""; bool bolRet = false; strPath = this.FilePath; try { this.FileExteCheck(strPath); //如果文件不存在,则创建文件 if(!File.Exists(strPath)) { las.foundation.SmartExcel.SmartExcel excelObj = new las.foundation.SmartExcel.SmartExcel(); excelObj.CreateFile(strPath); excelObj.PrintGridLines = false; excelObj.CloseFile(); } bolRet = this.Open(); } catch { bolRet = false; throw new Exception("创建Excel出现错误,请检查!"); } return bolRet; }