C#将EXCEL表中的每个表单独保存到本地
来源:互联网 发布:阿里云服务器管理 编辑:程序博客网 时间:2024/06/05 04:36
OpenFileDialog dlg = new OpenFileDialog();
dlg.Filter = "excel文件(*.xls,*.xlsx)|*.xls;*.xlsx";
if (dlg.ShowDialog() == DialogResult.OK)
{
string filename = dlg.FileName; //包含路径和文件名的全称
string path = Path.GetDirectoryName(filename);
string name = Path.GetFileNameWithoutExtension(filename);// 不含路径和后缀的文件名称
path = path + "\\" + name;
if (!Directory.Exists(path))
Directory.CreateDirectory(path);
SplashScreenManager.ShowForm(typeof(frmWaiting));
Workbook source = new Workbook();
source.LoadDocument(filename);
foreach (var item in source.Worksheets)
{
Workbook save = new Workbook();
save.Worksheets[0].CopyFrom(item);
save.Worksheets[0].Name = item.Name;
save.SaveDocument(path + "\\" + item.Name + ".xls", DocumentFormat.Xls);
save.Dispose();
}
source.Dispose();
SplashScreenManager.CloseForm();
MessageBox.Show("转换完成");
}
}
}
- C#将EXCEL表中的每个表单独保存到本地
- C#将遨游收藏夹中的网页自动保存到本地
- 将控件中的数据输出保存到本地excel或word中,同时保存图片到本地(c#)
- 将控件中的数据输出保存到本地excel或word中,同时保存图片到本地(c#)
- 将控件中的数据输出保存到本地excel或word中,同时保存图片到本地(c#)
- C# 将二进制字符串保存到本地
- 将GridView中的数据保存到excel并下载到本地
- 将项目中的资源保存到本地
- 将MSHFlexGrid中的数据保存到Excel表
- jsp 将数据导入 excel 保存到本地
- 将List下载到本地保存为Excel
- 将数据库里的数据保存到本地Excel
- 内表数据保存到本地EXCEL
- 将数据库里的数据保存到本地Excel表中
- C#将指定picturebox图片保存到本地
- c#将dataTable中的数据导出到Excel表中
- c#使用StreamWriter将DataTable保存到Excel
- 将ImageView中的图片保存到本地相册
- sscanf函数的用法 .
- id 的选择器为什么要这么写 li#first?
- python的assert\编码\thread
- osg示例解析之osgtexture1D(1)
- NEC SDN产品在美获奖
- C#将EXCEL表中的每个表单独保存到本地
- python_html和css文档格式化(一)
- wso2 identity server 的openid实例
- 静态库和动静态分析
- RHEL5.5 64位下安装Oracle 11g 64位安装前置条件的两种方法
- 天猫魔盒tmb100 ubootenv参数
- Android HttpClient 与JSON解析
- [BZOJ1977][Beijing2010组队][LCA][Kruskal]次小生成树
- Windows 7下阻止系统关机