Message-ID: <1929268074.7863.1711624425338.JavaMail.web05$@web05> Subject: Exported From Confluence MIME-Version: 1.0 Content-Type: multipart/related; boundary="----=_Part_7862_1260469326.1711624425338" ------=_Part_7862_1260469326.1711624425338 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.SPListItem listItem, String fileName)=20
Public Overridable Sub Save(ByVal excelApplication As ExcelApplication, ByV= al workbook As Workbook, ByVal listItem As Microsoft.SharePoint.SPListItem,= ByVal fileName As String)=20
Workbook
object representing the workbook to save.=20
//--- Retrieve current AllowUnsafeUpdates value bool currentAllowUnsafeUpdates =3D list.ParentWeb.AllowUnsafeUpdates; //--- You must allow unsafe updates in order for the file to be saved in th= e //--- List from a web application list.ParentWeb.AllowUnsafeUpdates =3D true; xla.Save(wb, listItem, "populated.xls"); //--- Update the list listItem.Update(); //--- Return the AllowUnsafeUpdates value to its original state list.ParentWeb.AllowUnsafeUpdates =3D currentAllowUnsafeUpdates;=20
'--- Retrieve current AllowUnsafeUpdates value Dim currentAllowUnsafeUpdates As Boolean =3D list.ParentWeb.AllowUnsafeUpda= tes '--- You must allow unsafe updates in order for the file to be saved in the '--- List from a web application list.ParentWeb.AllowUnsafeUpdates =3D True xla.Save(wb, listItem, "populated.xls") '--- Update the list listItem.Update() '--- Return the AllowUnsafeUpdates value to its original state list.ParentWeb.AllowUnsafeUpdates =3D currentAllowUnsafeUpdates=20