Memory Stream Error

I receive an error when trying to open the attached template using the following code in VB.NET:

_WorkBook = New Excel

With _WorkBook

Dim strPath As String = Application.StartupPath

Dim license As New Aspose.Excel.License

license.SetLicense(strPath & "\Aspose.Custom.lic.xml")

.Open(_strTemplatePath & _strTemplateName)

End With

The problem seems to be something in the "Preface" worksheet. If I remove this worksheet then everything works fine. Here is the stack trace:

StackTrace " at Aspose.Excel.?.?(MemoryStream ?)

at Aspose.Excel.?.?(String ?)

at Aspose.Excel.Excel.Open(String fileName)

at ARDesktop.clsTPAReviewTemplate.Load() in C:\Local Projects\AccountReview\AccountReviewSln\ARDesktop\clsTPAReviewTemplate.vb:line 167" String


Thank you for your help.

Try this attached fix, please.

Sorry not to reply sooner. The attached fix worked perfectly! Thank you.