Free Support Forum - aspose.com

Document not Saved

I am having a strange problem with a spreadsheet I've created with your control. It opens and edits just fine in Excel, but when I try to perform a Save or Save As, I get a "Document Not Saved" msgbox. I'm using 3.7.1.3 with the following code in a .Net 2.0 windows service.

Public Function GenerateFile(ByVal drForm As DataRow, ByVal _ar As ArrayList, ByVal filename As String) As Boolean
Try
'Set the licensing for the Aspose.Cells control
Dim license As Aspose.Cells.License = New Aspose.Cells.License
license.SetLicense("Aspose.Excel.lic")

Dim _excel As New Excel
_excel.Open(My.Settings.TemplateFolderPath & drForm("template"))
Dim _wk As Worksheet = _excel.Worksheets(0)

'Dim _dr As DataRow = drData(0)
Dim _mac As clsMachine = _ar.Item(0)

'A bunch of _wk.Cells(row, col).PutValue() statements

_excel.Save(filename)

Return True
Catch ex As Exception
Throw ex

Return False
End Try

End Function

Thanks,

Rob

Turns out it is actually an Excel bug. If you use a template with embedded objects, this may happen. I've updated my template to remove them, and its no longer an issue.

See http://support.microsoft.com/default.aspx?scid=kb;en-us;121942&Product=xlw97 for more detail.

Thanks,

Rob