如何以ediatable格式保存excel工作簿? [英] How do I save an excel workbook in ediatable format ?

查看:83
本文介绍了如何以ediatable格式保存excel工作簿?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

目前我以编程方式保存工作簿。然后在应用程序外部打开它,并在进行一些更改后尝试保存。我被要求另存为。







Microsoft.Office.Interop.Excel.Workbook l_objExcelworkBook;



l_objExcelworkBook.SaveAs( c:\\test,Microsoft.Office.Interop.Excel.XlFileFormat.xlWorkbookDefault,Type.Missing,Type.Missing,

false,false,Microsoft.Office.Interop.Excel.XlSaveAsAccessMode .xlNoChange,

Type.Missing,Type.Missing,Type.Missing,Type.Missing,Type.Missing);

Currently when I save the workbook programmatically.And then open it outside the application and try to save it after making some changes .I'm asked to Save As.



Microsoft.Office.Interop.Excel.Workbook l_objExcelworkBook;

l_objExcelworkBook.SaveAs("c:\\test", Microsoft.Office.Interop.Excel.XlFileFormat.xlWorkbookDefault, Type.Missing, Type.Missing,
false, false, Microsoft.Office.Interop.Excel.XlSaveAsAccessMode.xlNoChange ,
Type.Missing, Type.Missing, Type.Missing, Type.Missing, Type.Missing);

推荐答案

我处理的方法是使用.xlExclusive用于SaveAsAccessMode属性。



The way i deal with this is using the .xlExclusive for the SaveAsAccessMode attribute.

l_objExcelworkBook.SaveAs("c:\\test", Microsoft.Office.Interop.Excel.XlFileFormat.xlWorkbookDefault,
Type.Missing, Type.Missing, false, false, Microsoft.Office.Interop.Excel.XlSaveAsAccessMode.xlExclusive ,
Type.Missing, Type.Missing, Type.Missing, Type.Missing, Type.Missing); 





应该可以正常工作。



Should work nicely.


这篇关于如何以ediatable格式保存excel工作簿?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆