Dim app As New Microsoft.Office.Interop.Excel.Application()app.Visible = Falseapp.DisplayAlerts = FalseDim wbks As Microsoft.Office.Interop.Excel.Workbooks = app.WorkbooksDim workbook As Microsoft.Office.Interop.Excel.Workbook = app.Workbooks._Open("文件目录", Type.Missing, Type.Missing, Type.Missing, Type.Missing, Type.Missing, Type.Missing, Type.Missing, Type.Missing, Type.Missing, Type.Missing, Type.Missing, Type.Missing)'获取sheetDim sheet As Microsoft.Office.Interop.Excel.Worksheet = CType(workbook.Worksheets(1), Microsoft.Office.Interop.Excel.Worksheet)'添加sheet'workbook.Worksheets.Add()'复制sheetsheet.Copy(Type.Missing, sheet)'保存Excelworkbook.Save()'workbook.SaveAs(filepath, Type.Missing, Type.Missing, Type.Missing, Type.Missing, Type.Missing, Microsoft.Office.Interop.Excel.XlSaveAsAccessMode.xlExclusive, Type.Missing, Type.Missing, Type.Missing, Type.Missing, Type.Missing)'关闭Excelworkbook.Close(False, DBNull.Value, DBNull.Value)app.Workbooks.Close()app.Quit()'回收内存GC.WaitForPendingFinalizers()GC.Collect()

Windows 控件 Microsoft.Office.Interop.Excel 复制sheet相关推荐

  1. C#利用Microsoft.Office.Interop.Excel导出excel文件

    导入Microsoft.Office.Interop.Excel.dll文件引用   为了能够导出excel文件,由于使用的是Microsoft.Office.Interop.Excel,所以我们首先 ...

  2. C#项目添加excel引用Microsoft.Office.Interop.Excel.dll

    C#项目添加excel引用Microsoft.Office.Interop.Excel.dll zgscwxd 2019-01-21 15:40:26  2286  收藏 4 展开 如果需要使用C#处 ...

  3. C#处理excel引用Microsoft.Office.Interop.Excel

    如果需要使用C#处理excel,需要引用Microsoft.Office.Interop.Excel;如何找到这个dll文件啊. (1)windows 全盘搜索 Microsoft.Office.In ...

  4. 解决无法找到Microsoft.Office.Interop.Excel并将其分离的方法

    很多人在使用VS操作excel的时候总是会苦恼找不到Microsoft.Office.Interop.Excel,一般来说如果不是特别必要,我们可以直接导入excel.exe文件,但是如果是在多人联合 ...

  5. System.IO.FileNotFoundException: 未能加载文件或程序集“Microsoft.Office.Interop.Excel, Version=11.0.0.0, Cultur

    c# 程序突然出错 System.IO.FileNotFoundException: 未能加载文件或程序集"Microsoft.Office.Interop.Excel, Version=1 ...

  6. 解决方法:未能加载文件或程序集“Microsoft.Office.Interop.Excel。。。”

    Could not load file or assembly 'Microsoft.Office.Interop.Excel, Version=11.0.0.0, Culture=neutral 出 ...

  7. 我的Office PIA之路(一) Microsoft.Office.Interop.Excel.dll 的获取

    最近有一个项目,是要用程序把学校里一个年级的学籍信息经过处理合成一个表,小学共六个年级,生成六张表,而且是*.xls文件,通过查找资料我决定使用Office PIA来试试.我最开始查到我资料是说要在A ...

  8. Net使用Microsoft.Office.Interop.Excel;创建Excel文件(插入数据、修改格式、生成图表)的方法,以及Excel查看加密

    具体使用方法可以参照文章: http://blog.csdn.net/tuoxie5431/article/details/3937752 Microsoft.Office.Interop.Excel ...

  9. C# Microsoft.Office.Interop.Excel分组汇总

    效果如下: using System; using System.Collections.Generic; using System.ComponentModel; using System.Data ...

最新文章

  1. 总结 - 沉寂了大半年后的又一次
  2. gentoo下gnome的抓图功能
  3. [密码学] RSA利用解密指数分解n
  4. linux 查看内存用量_正确计算linux系统内存使用率
  5. Matlab如何实现建立ROS节点并进行实时通讯
  6. AngularJS源码解析2:注入器的详解
  7. linux集群启动脚本,Hadoop2.2.0集群启动和停止Shell脚本
  8. B样条曲线的一些基本性质
  9. Error installing to Instantiated: name=AttachmentStore state=Described
  10. 主机开启后,显示器显示NO SIGNAL,无信号
  11. 商务英语基础: 口语 | Essential Business English: Speaking
  12. androID程序!BAT大厂面试基础题集合,附带学习经验
  13. python中语法错误-Python语法错误与异常及异常处理方法
  14. 浅谈通用的字典表结构设计
  15. 读书笔记-《基于Oracle的SQL优化》-第二章-1
  16. 2021年完美的借条怎么写
  17. 解决maven无法下载依赖的问题
  18. 能量星球!无线电力传输技术走进现…
  19. Yii使用find findAll查找使用
  20. 语不惊人死不休--2004年一针见血的名言

热门文章

  1. 广东工业大学数据库课设(点歌系统)
  2. 【python+selenium】点触文字验证码的识别
  3. 道周中学2012年高三地理寒假作业答案
  4. OpenGL /GLES 使用Pyqt5 + glad
  5. PAT B1033旧键盘打字
  6. 小米10pro使用说明书_入手小米10pro,开箱设置评测,尽在本篇
  7. 用Python分割文件夹
  8. shell脚本实现批量解析域名IP地址(支持多DNS)
  9. 习惯养成android软件,六款有助于养成良好习惯的APP(安卓)
  10. Linux下脚本编写局域网扫描工具