C#中另存为xls格式,用WorkBook.SaveAs 5
//保存方式一:保存WorkBookxBook.SaveAs(@"D:\CData.xls",56,Missing.Value,Missing.Value,Missing...
//保存方式一:保存WorkBook
xBook.SaveAs(@"D:\CData.xls",
56,Missing.Value,Missing.Value,Missing.Value,Missing.Value,
Excel.XlSaveAsAccessMode.xlNoChange,Missing.Value,Missing.Value,Missing.Value,
Missing.Value,Missing.Value); C#里面想用这个把xlsx文件转成xls文件,但是每次转之后都还是之前的xlsx格式,第二个参数是fileFormat,但是换之后还是不行 展开
xBook.SaveAs(@"D:\CData.xls",
56,Missing.Value,Missing.Value,Missing.Value,Missing.Value,
Excel.XlSaveAsAccessMode.xlNoChange,Missing.Value,Missing.Value,Missing.Value,
Missing.Value,Missing.Value); C#里面想用这个把xlsx文件转成xls文件,但是每次转之后都还是之前的xlsx格式,第二个参数是fileFormat,但是换之后还是不行 展开
1个回答
展开全部
试试这个行吗:
string fileName = @"C:\Users\L-3\Desktop\my.xlsx";
string svfileName = @"C:\Users\L-3\Desktop\ssc\my1.xls";
object oMissing = Type.Missing;
var app = new Microsoft.Office.Interop.Excel.Application();
var wb = app.Workbooks.Open(fileName, oMissing, oMissing,
oMissing, oMissing, oMissing, oMissing, oMissing, oMissing, oMissing, oMissing, oMissing, oMissing, oMissing, oMissing);
wb.SaveAs(svfileName, XlFileFormat.xlExcel8, Type.Missing, Type.Missing, Type.Missing, Type.Missing, XlSaveAsAccessMode.xlExclusive, Type.Missing, Type.Missing, Type.Missing, Type.Missing, Type.Missing);
app.Quit();
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询