Message-ID: <930346514.8119.1711632768259.JavaMail.web05$@web05> Subject: Exported From Confluence MIME-Version: 1.0 Content-Type: multipart/related; boundary="----=_Part_8118_1086893928.1711632768259" ------=_Part_8118_1086893928.1711632768259 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Content-Location: file:///C:/exported.html
Saves a specified Workbook as a BI= FF8 format (Excel 97 or later) .xls file.
=20public static void Save(this ExcelApplication excelApplication, Workbook wo= rkbook, Microsoft.SharePoint.SPDocumentLibrary docLib, String fileName, boo= l overwrite)=20
Public Overridable Sub Save(ByVal excelApplication As ExcelApplication, ByV= al workbook As Workbook, ByVal docLib As Microsoft.SharePoint.SPDocumentLib= rary, ByVal fileName As String, ByVal overwrite As Boolean)=20
Workbook
object representing the workbook to save.=20
//--- Retrieve current AllowUnsafeUpdates value bool currentAllowUnsafeUpdates =3D documentLibrary.ParentWeb.AllowUnsafeUpd= ates; //--- You must allow unsafe updates in order for the file to be saved in th= e //--- Document Library from a web application documentLibrary.ParentWeb.AllowUnsafeUpdates =3D true; xla.Save(wb, documentLibrary, "populated.xls", true); //--- Update the document library documentLibrary.Update(); //--- Return the AllowUnsafeUpdates value to its original state documentLibrary.ParentWeb.AllowUnsafeUpdates =3D currentAllowUnsafeUpdates;=20
'--- Retrieve current AllowUnsafeUpdates value Dim currentAllowUnsafeUpdates As Boolean =3D documentLibrary.ParentWeb.Allo= wUnsafeUpdates '--- You must allow unsafe updates in order for the file to be saved in the '--- Document Library from a web application documentLibrary.ParentWeb.AllowUnsafeUpdates =3D True xla.Save(wb, documentLibrary, "populated.xls", True) '--- Update the document library documentLibrary.Update() '--- Return the AllowUnsafeUpdates value to its original state documentLibrary.ParentWeb.AllowUnsafeUpdates =3D currentAllowUnsafeUpdates=20