Export to EXCEL 2007 with Header Issue

Posted by: blackbenzo on 8 September 2017, 2:28 pm EST

  • Posted 8 September 2017, 2:28 pm EST

    <P>Hello,</P>
    <P>Anyone know how to export spread sheet to excel with header?</P>
    <P>I couldn't figure it out.. pls help me.</P>
    <P> </P>
    <P>If SaveFileDialog1.ShowDialog = Windows.Forms.DialogResult.OK Then<BR>            Try</P>
    <P>                strFileName = SaveFileDialog1.FileName</P>
    <P>                Dim ret As Boolean<BR>              <BR>                'Save</P>
    <P>                '  ret = fpSpread.SaveExcel(strFileName, FarPoint.Excel.ExcelSaveFlags.SaveBothCustomRowAndColumnHeaders)<BR>                Dim f As String</P>
    <P>                f = strFileName</P>
    <P>                Dim s As New System.IO.FileStream(f, IO.FileMode.Create, IO.FileAccess.ReadWrite)<BR>                fpSpread.ActiveSheet.Protect = False<BR>                ret = fpSpread.SaveExcel(s, FarPoint.Excel.ExcelSaveFlags.UseOOXMLFormat)<BR>                s.Close()<BR>                If (ret = False) Then</P>
    <P>                    MsgBox("PROBLEM: Could not save file - ")<BR>                End If</P>
    <P>                MsgBox("Completed")</P>
    <P>            Catch ex As Exception<BR>                Throw ex<BR>            End Try<BR>        Else<BR>            Exit Sub<BR>        End If</P>
  • Replied 8 September 2017, 2:28 pm EST

    <P>Have you tried FarPoint.Excel.ExcelSaveFlags.SaveAsViewed ? If that doesn't work can you send me a copy of your spread sheet with your headers that I can try it out with?</P>
Need extra support?

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

Learn More

Forum Channels