惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

博客园_首页
PCI Perspectives
PCI Perspectives
T
Tailwind CSS Blog
月光博客
月光博客
Apple Machine Learning Research
Apple Machine Learning Research
大猫的无限游戏
大猫的无限游戏
V
V2EX
D
Docker
P
Proofpoint News Feed
阮一峰的网络日志
阮一峰的网络日志
博客园 - 司徒正美
酷 壳 – CoolShell
酷 壳 – CoolShell
云风的 BLOG
云风的 BLOG
H
Help Net Security
The Register - Security
The Register - Security
宝玉的分享
宝玉的分享
C
Check Point Blog
T
Threatpost
The GitHub Blog
The GitHub Blog
P
Privacy International News Feed
G
Google Developers Blog
博客园 - Franky
爱范儿
爱范儿
T
Tor Project blog
博客园 - 聂微东
Google DeepMind News
Google DeepMind News
G
GRAHAM CLULEY
雷峰网
雷峰网
Cyberwarzone
Cyberwarzone
人人都是产品经理
人人都是产品经理
C
Cybersecurity and Infrastructure Security Agency CISA
Vercel News
Vercel News
Scott Helme
Scott Helme
aimingoo的专栏
aimingoo的专栏
Martin Fowler
Martin Fowler
MyScale Blog
MyScale Blog
Last Week in AI
Last Week in AI
GbyAI
GbyAI
Microsoft Azure Blog
Microsoft Azure Blog
腾讯CDC
K
Kaspersky official blog
D
Darknet – Hacking Tools, Hacker News & Cyber Security
Project Zero
Project Zero
F
Fortinet All Blogs
AWS News Blog
AWS News Blog
The Cloudflare Blog
C
CERT Recently Published Vulnerability Notes
I
InfoQ
Spread Privacy
Spread Privacy
T
Tenable Blog

博客园 - 陈典洪

ASP.NET生成Excel文件的历程总结 C# Excel操作类 SharePoint 2010 安装部署 用VSTA动态改变infopath数据源查询参数与反回查询结果 用VS2010为SharePoint 2010 添加Ribbon自定义按钮 在sql server 中如何移动tempdb到新的位置 禁用MOSS2007“我的网站”功能 使用Exchange 2007搭建多域名邮件系统 Exchange 2007 配置 如何简化Exchange 2007 OWA URL访问 [转载]利用MOSS文档库自制一个山寨版mp3在线播放器 - 陈典洪 - 博客园 MOSS中自定义WebService与客户端应用 将项目从vs2008转到Vs2005的办法 如何控制列表视图栏位的宽度? WSS(MOSS)如何修改Rich文本编辑器的宽度 WSS 3.0 and MOSS 2007 SDK 更新到了1.5版本啦 moss 自定义文档库文档图标 - 陈典洪 - 博客园 moss 列表类型和对应类型编号 MOSS LIST的一些属性说明
将excel2003转换为excel2007格式
陈典洪 · 2010-07-27 · via 博客园 - 陈典洪

在sharepoint 2010 中,excel2007或excel 2010文档格式,支持web app 应用,能够在浏览器在线打开,查看,但excel 2003格式的文档只能用office客户端打开,为了让上传的文档能够直接支持web app,只能将上传的excel 2003文档转换成excel 2007 文档再上传。文档转换的code如下:

代码

  //将excel2003转换成excel2007
                  MSExcel.Application excelApp = null;//提要   //word应用程序
                    MSExcel._Workbook excelDoc = null;    //word文档
                    Object nothing = Missing.Value;
                 excelApp 
= new MSExcel.ApplicationClass();string sourcePath = @"c:\excel2003.xls";      //原文件路径
                 excelDoc = excelApp.Workbooks.Open(sourcePath, nothing,
                         nothing, nothing, nothing, nothing,
                         nothing, nothing, nothing, nothing,
                         nothing, nothing, nothing, nothing,
                         nothing);
                   
                 
string targetPath =@"c:\excel2007.xlsx";//导出路径
                 object format = MSExcel.XlFileFormat.xlWorkbookDefault;//转换成新的格式//将新的exccel2007存到本地
                    excelApp.DisplayAlerts = false;//文档转换过程不要出现提示框
                    excelDoc.SaveAs(targetPath, format, nothing, nothing, nothing, nothing, MSExcel.XlSaveAsAccessMode.xlNoChange,
                               nothing, nothing, nothing, nothing, nothing);
                    excelDoc.Close(nothing, nothing, nothing);
                    excelApp.Quit();