ExcelWarning object

Posted by: judir on 8 September 2017, 1:14 pm EST

  • Posted 8 September 2017, 1:14 pm EST

    <FONT face=Arial size=2>I am opening an Excel file and using the form that takes a filename and WarningList.</FONT>


    <FONT size=2>Fp1.OpenExcel(<FONT color=#800000>"C:\esp2008\Prototype\JR\FPFromXLS\FPFromXLS\XLS\"</FONT> & sFName & <FONT color=#800000>".xls"</FONT>, myWarnings)</FONT>


    <FONT face=Arial size=2>I get a warning on a sheet that I don't understand and cannot seem to find any documentation of the ExcelWarning and ExcelWarningList objects.  (I am using version 2.5.2010.2005 Spread for Windows Forms).</FONT>


    <FONT size=2><FONT color=#0000ff>Dim</FONT> aWarn <FONT color=#0000ff>As</FONT> FarPoint.Excel.ExcelWarning</FONT>


    <FONT size=2><FONT color=#0000ff>For</FONT> <FONT color=#0000ff>Each</FONT> aWarn <FONT color=#0000ff>In</FONT> myWarnings.WarningList</FONT>


    <FONT size=2>txtStatus.Text &= vbCrLf & aWarn.Code.ToString & <FONT color=#800000>" "</FONT> & aWarn.Message.ToString & <FONT color=#800000>" at "</FONT> & Fp1.Sheets(aWarn.Sheet).SheetName & <FONT color=#800000>" Row: "</FONT> & aWarn.Row.ToString & <FONT color=#800000>" Col: "</FONT> & aWarn.Column.ToString</FONT>


    <FONT color=#0000ff size=2>Next</FONT>


    <FONT color=#0000ff><FONT face=Arial color=#000000 size=2>produces this </FONT></FONT>


    <FONT color=#0000ff size=2>FormulaErrorNotifyFarPoint Unsupported ptg found: ag at sheet1 Row: 15 Col: 2</FONT>


    <FONT color=#0000ff><FONT face=Arial color=#000000 size=2>I'm attaching the file.  Please help me understand why this is producing this warning and what this warning means; and I would really like to know where to find information on this type of object.</FONT></FONT>


    <FONT face=Arial size=2>thanks</FONT>


    2008/05/FPWarn.zip
  • Replied 8 September 2017, 1:14 pm EST

    Scott


    Thanks for the advice.  I installed ver4 (4.0.2003.2005) and am now trying to open the large xls (29 sheets minus the 1 problem sheet that I sent you), but now I throw an exception and nothing is available. This is the exception:

    <FONT size=1><FONT size=1>

    A first chance exception of type 'System.ArgumentException' occurred in FarPoint.Win.Spread.dll


    System.ArgumentException: Value does not fall within the expected range.


    at c9.a(String A_0, Stream A_1, Int32 A_2, String A_3, Int32 A_4, String A_5, ExcelOpenFlags A_6, ExcelWarningList A_7)


    at FarPoint.Win.Spread.FpSpread.a(Stream A_0, Int32 A_1, String A_2, Int32 A_3, String A_4, ExcelOpenFlags A_5, ExcelWarningList A_6)


    at FarPoint.Win.Spread.FpSpread.OpenExcel(Stream stream, ExcelWarningList warningList)


    at FPFromXLS.Form1.cmdOpenInSQLExpress_Click(Object sender, EventArgs e) in C:\esp2008\Prototype\JR\FPFromXLS\FPFromXLS\Form1.vb:line 327


    </FONT></FONT>The code at line 327 is    


    <FONT size=2>Fp1.OpenExcel(fs2, myWarnings)   </FONT>


    With ver 2.5 this same file from a BLOB was opening fine, and as long as I left the sheet out that had the warning it opened with no warnings generated.


    Please advise as to how I should approach these large files to be able to load them.  At least ver 2.5 did that and let me know there was a problem.

  • Replied 8 September 2017, 1:14 pm EST

    Hello,


    Could you post the Excel file you are trying to open for us to debug the new issue you are seeing?

  • Replied 8 September 2017, 1:14 pm EST

    Hello,


    I tested this with the latest version of Spread (version 4) and I do not get any warnings, but the formula in this cell does not load correctly, so I reported this as a bug in Spread. However, we are not doing any more maintenance releases of Spread for Windows Forms version 2.5. It will be fixed in the next release of version 4.

  • Replied 8 September 2017, 1:14 pm EST

    Scott I will try to send a file that has this problem but need to remove all proprietary content first, so it may take me a day or so.  In the meantime I was going to try version 3; how long will that version be supported?

  • Replied 8 September 2017, 1:14 pm EST

    <FONT size=2>Scott, I think I found what is causing the exception; it looks like some remnants of what I believe were old style Excel macros.  Ver 2.5 just seems to ignore them, but ver 4.0 cannot recover.  I isolated the sheet and actually removed some rows and columns that had proprietary sheet names referenced, but with just a few remnants the OpenExcel method is aborted.  I added the other sheet that had the warning and the resulting file will open with Ver2.5 but not with ver 4.0 (4.0.2003.2005).  This is the exception</FONT>

    <FONT size=1>

    System.ArgumentException: Value does not fall within the expected range.


    at c9.a(String A_0, Stream A_1, Int32 A_2, String A_3, Int32 A_4, String A_5, ExcelOpenFlags A_6, ExcelWarningList A_7)


    at FarPoint.Win.Spread.FpSpread.a(Stream A_0, Int32 A_1, String A_2, Int32 A_3, String A_4, ExcelOpenFlags A_5, ExcelWarningList A_6)


    at FarPoint.Win.Spread.FpSpread.OpenExcel(Stream stream, ExcelOpenFlags openFlags, ExcelWarningList warningList)


    at FP_Ver4_FromXLS.frmVer4.cmdOpenBLOB_Click(Object sender, EventArgs e) in C:\esp2008\Prototype\JR\FP_Ver4_FromXLS\FP_Ver4_FromXLS\frmVer4.vb:line 297


    <FONT size=2>yet in ver 2.5 it can open and sees that there is a problem at Row 15 Col 2.</FONT>


    <FONT size=2>If I open just the sheet with the problem in ver 4.0, it only shows "#NAME?" in the cell.  </FONT>


    <FONT size=2>Is there a way to save the initial formula? It was "=ROUND(IF(AND(C14>0,C11>0),C14/C11,0),3)"</FONT>


    <FONT size=2>Thanks for the help, by removing these rements of old macros I can load my entire file, but I still would like to know where there were items that could not be expressed, like row 15 col 2 in my example.</FONT>


    <FONT size=3></FONT> 

    </FONT>
    2008/05/T6_ver4.zip
  • Replied 8 September 2017, 1:14 pm EST

    Hello,


    The first issue I am able to reproduce and have reported this as a bug (#22514) for the development team to fix for the next maintenance release. The other issue, I reported as a bug (#22496) the other day.

Need extra support?

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

Learn More

Forum Channels