formulas do not export with spread

Posted by: flyrod1 on 8 September 2017, 1:48 pm EST

  • Posted 8 September 2017, 1:48 pm EST


    I have a spread using spread 7 that I am exporting to an excel formatted file. In the spread I have 2 columns (g and h)  that are defined as date. I have another column that is defined as a number with the formula  sum(g#-h#)  which gives me the result of the number of days difference between the to columns defined as date. The formula works perfect in the spread. However when I export the spread to Excel, the formulas do not export. I have listed the code that I use to export the spread at the bottom.


    Am I doing something wrong code wise, or is this a problem with spread 7?


     


     


    Code used to export the spread to excel formatted file:


     


    Public Sub ExportFileToExcel(objfpspread1 As fpSpread)


    objfpspread1.ExportExcelBook strfilename & ".XLS"


    Dim objExcel As Excel.Application


    Dim objBook As Excel.Workbook


    Dim objsheet As Excel.Worksheet


    Dim objrange As Excel.Range


    Set objExcel = New Excel.Application


    Set objBook = objExcel.Workbooks.Open(strfilename & ".XLS")


    Set objsheet = objBook.Sheets(1)


    objBook.Unprotect


    objsheet.Unprotect


    objsheet.Range("1:1").Insert


    objfpspread1.Col = 1


    objfpspread1.Row = 1


    Dim x As Integer


    For x = 1 To objfpspread1.MaxCols


    objfpspread1.Col = x


    objsheet.Range(Chr(64 + x) & "1").Value = objfpspread1.Text


    Next


    objsheet.Range("A1:" & Chr( _


    64 + objfpspread1.MaxCols) & objfpspread1.MaxRows + 1).Locked = False


    objsheet.Protect Contents:=False, UserInterfaceOnly:=True, AllowFormattingCells:=True, AllowFormattingColumns:=True


    objBook.Save


    Set objsheet = Nothing


    objBook.Close


    Set objBook = Nothing


    objExcel.Quit


    Set objExcel = Nothing


     


     


    Any help is greatly appreciated.

  • Replied 8 September 2017, 1:48 pm EST

    Hello Flyrod,


    Spread exposes SaveExcel methods which provide various ways to save data to an Excel file.


    These methods save the contents of the sheets of the FarPoint Spread component to an Excel-compatible BIFF8 (Binary Interchange File Format, version 8 from Microsoft) file. This is the file format for several versions of Microsoft Excel (Excel 97, Excel 2000, and Excel XP).


    You may refer the help file to know the various overloaded SaveExcel methods along with supported ExcelSaveFlags options.


    Regards,

Need extra support?

Upgrade your support plan and get personal unlimited phone support with our customer engagement team

Learn More

Forum Channels