zoukankan      html  css  js  c++  java
  • 将excel2003文档文件转换为excel2007格式

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

    Code highlighting produced by Actipro CodeHighlighter (freeware)http://www.kindeditor.com/-->  //将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();

  • 相关阅读:
    [usaco3.2.5]msquare
    [usaco3.2.4]ratios
    [usaco3.2.3]spin
    [文献记录] Few-shot Learning for Named Entity Recognition in Medical Text 医学文本中命名实体识别的小样本学习
    计算机保研经验分享
    文本处理、词频统计与Simhash生成文档指纹
    [知乎live笔记]如何得到好的科研Idea
    POJ 2787:算24
    POJ 2964:日历问题 日期转换+闰年月份可放在一个month[2][12]数组里
    POJ-1835 宇航员 空间方向模拟+打表
  • 原文地址:https://www.cnblogs.com/lbkjw/p/3907908.html
Copyright © 2011-2022 走看看