首页 > 代码库 > Excel.Application SaveAs 把excel转换为html

Excel.Application SaveAs 把excel转换为html


Excel.Application

SaveAs中的第二个参数的值:

可以直接用10进制的值代替左边的这些 xl类型.

 

例如:把excel转换为html的js:

var oWB = oXL.Workbooks.open("d:\test.xls");oWB.worksheets(i).select();var oSheet = oWB.ActiveSheet;oSheet.SaveAs("d:\test.html",44); 

 

 

 

 

fileformat 类型       十进制值  具体文件类型

xlAddIn18 Microsoft Excel 2007 Add-In

xlAddIn818 Microsoft Excel 97-2003 Add-In

xlCSV 6CSV

xlCSVMac22 Macintosh CSV

xlCSVMSDOS24 MSDOS CSV

xlCSVWindows23 Windows CSV

xlCurrentPlatformText-4158 Current Platform Text

xlDBF2 7DBF2

xlDBF3 8DBF3

xlDBF4 11DBF4

xlDIF 9DIF

xlExcel1250 Excel12

xlExcel216 Excel2

xlExcel2FarEast27 Excel2 FarEast

xlExcel329 Excel3

xlExcel433 Excel4

xlExcel4Workbook35 Excel4 Workbook

xlExcel539 Excel5

xlExcel739 Excel7

xlExcel856 Excel8

xlExcel979543 Excel9795

xlHtml 44HTML format

xlIntlAddIn26 International Add-In

xlIntlMacro25 International Macro

xlOpenXMLAddIn55 Open XML Add-In

xlOpenXMLTemplate54 Open XML Template

xlOpenXMLTemplateMacroEnabled53 Open XML Template Macro Enabled

xlOpenXMLWorkbook51 Open XML Workbook

xlOpenXMLWorkbookMacroEnabled52 Open XML Workbook Macro Enabled

xlSYLK 2SYLK

xlTemplate17 Template

xlTemplate817 Template 8

xlTextMac19 Macintosh Text

xlTextMSDOS21 MSDOS Text

xlTextPrinter36 Printer Text

xlTextWindows20 Windows Text

xlUnicodeText42 Unicode Text

xlWebArchive45 Web Archive

xlWJ2WD114 WJ2WD1

xlWJ3 40WJ3

xlWJ3FJ341 WJ3FJ3

xlWK1 5WK1

xlWK1ALL31 WK1ALL

xlWK1FMT30 WK1FMT

xlWK3 15WK3

xlWK3FM332 WK3FM3

xlWK4 38WK4

xlWKS 4Worksheet

xlWorkbookDefault51 Workbook default

xlWorkbookNormal-4143 Workbook normal

xlWorks2FarEast28 Works2 FarEast

xlWQ1 34WQ1

xlXMLSpreadsheet46 XML Spreadsheet