Saving to an Excel file

Posted by: ebw on 8 September 2017, 1:27 pm EST

  • Posted 8 September 2017, 1:27 pm EST

    <P class=MsoNormal style="MARGIN:0in 0in 0pt;"><SPAN style="FONT-SIZE:10pt;"><FONT face="Times New Roman">Version:<SPAN style="mso-spacerun:yes;">   </SPAN><SPAN style="mso-spacerun:yes;"> </SPAN>4.0.2003.2005<o:p></o:p></FONT></SPAN></P>
    <P class=MsoNormal style="MARGIN:0in 0in 0pt;"><SPAN style="FONT-SIZE:10pt;"><o:p><FONT face="Times New Roman"> </FONT></o:p></SPAN></P>
    <P class=MsoNormal style="MARGIN:0in 0in 0pt;"><SPAN style="FONT-SIZE:10pt;"><FONT face="Times New Roman">I open a simple Excel file in Spread. The Excel file has certain cells that have a yellow background (fill color) and some have a no fill color. <o:p></o:p></FONT></SPAN></P>
    <P class=MsoNormal style="MARGIN:0in 0in 0pt;"><SPAN style="FONT-SIZE:10pt;"><FONT face="Times New Roman">After saving it to an Excel format and reopen it, the yellow background color is lost. Any thoughts?<o:p></o:p></FONT></SPAN></P>
    <P class=MsoNormal style="MARGIN:0in 0in 0pt;"><SPAN style="FONT-SIZE:10pt;"><o:p><FONT face="Times New Roman"> </FONT></o:p></SPAN></P>
    <P class=MsoNormal style="MARGIN:0in 0in 0pt;"><SPAN style="FONT-SIZE:10pt;"><FONT face="Times New Roman">Code to save the .xls file:<o:p></o:p></FONT></SPAN></P>
    <P class=MsoNormal style="MARGIN:0in 0in 0pt;mso-layout-grid-align:none;"><SPAN style="FONT-SIZE:10pt;FONT-FAMILY:'Courier New';mso-no-proof:yes;"><SPAN style="mso-spacerun:yes;">  </SPAN><SPAN style="COLOR:blue;">Dim</SPAN> xlwWarnings <SPAN style="COLOR:blue;">As</SPAN> FarPoint.Excel.ExcelWarningList<o:p></o:p></SPAN></P>
    <P class=MsoNormal style="MARGIN:0in 0in 0pt;mso-layout-grid-align:none;"><SPAN style="FONT-SIZE:10pt;COLOR:blue;FONT-FAMILY:'Courier New';mso-no-proof:yes;"><SPAN style="mso-spacerun:yes;">  </SPAN>Dim</SPAN><SPAN style="FONT-SIZE:10pt;FONT-FAMILY:'Courier New';mso-no-proof:yes;"> bResult <SPAN style="COLOR:blue;">As</SPAN> <SPAN style="COLOR:blue;">Boolean</SPAN><SPAN style="mso-spacerun:yes;">  </SPAN><o:p></o:p></SPAN></P>
    <P class=MsoNormal style="MARGIN:0in 0in 0pt;mso-layout-grid-align:none;"><SPAN style="FONT-SIZE:10pt;FONT-FAMILY:'Courier New';mso-no-proof:yes;"><SPAN style="mso-spacerun:yes;">  </SPAN>xlwWarnings = <SPAN style="COLOR:blue;">New</SPAN> FarPoint.Excel.ExcelWarningList<o:p></o:p></SPAN></P>
    <P class=MsoNormal style="MARGIN:0in 0in 0pt;mso-layout-grid-align:none;"><SPAN style="FONT-SIZE:10pt;FONT-FAMILY:'Courier New';mso-no-proof:yes;"><SPAN style="mso-spacerun:yes;"> </SPAN><SPAN style="COLOR:green;"><SPAN style="mso-spacerun:yes;"> </SPAN></SPAN>bResult = FpSS1.SaveExcel(“Testfile.xls”, xlwWarnings)</SPAN></P>
    <P class=MsoNormal style="MARGIN:0in 0in 0pt;mso-layout-grid-align:none;"><SPAN style="FONT-SIZE:10pt;FONT-FAMILY:'Courier New';mso-no-proof:yes;"></SPAN> </P>
    <P class=MsoNormal style="MARGIN:0in 0in 0pt;mso-layout-grid-align:none;"><SPAN style="FONT-SIZE:10pt;FONT-FAMILY:'Courier New';mso-no-proof:yes;">Thanks, ebw</SPAN></P>
  • Replied 8 September 2017, 1:27 pm EST

    <P>ebw,</P>
    <P>When writing Excel files we use the standard 40 color palatte. If this yellow color is not one of the default 40 colors, then it would be replaced by the closest color in the default 40 colors. In the latest maintenance release of Spread for Windows Forms, we have now added source to create a custom palatte when ecporting to Excel. You should see with the latest mainteance release that this is now working.</P>
  • Replied 8 September 2017, 1:27 pm EST

    Thanks Scott. What is the version number of the latest maintenance release that's available?
  • Replied 8 September 2017, 1:27 pm EST

    <P>Hello,</P>
    <P>It is version 4.0.2005.2005 and can be gotten from our website <A href="http://www.clubfarpoint.com/">www.clubFarPoint.com</A> by clicking on the Updates link on the left of the page.</P>
Need extra support?

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

Learn More

Forum Channels