Opening an Excel file

Posted by: rene1983 on 8 September 2017, 2:31 pm EST

  • Posted 8 September 2017, 2:31 pm EST

    I need to open an Excel file, show only the first sheet and put the first row into the column headers.  This is a C# (VS2008 project).

    I've tried to use fpSpread1.OpenExcel() and fpSpread1.ActiveSheet.OpenExcel().  It seems that using fpSpread1.ActiveSheet.OpenExcel(), I can open the correct worksheet but not populate the column titles.  If I use fpSpread1.OpenExcel(), I can populate the column titles but it opens all sheets.

    Is there a way to do both?

    I also noticed that the only way to populate the column headers are with a frozen row.  Is there any other way to do this?

    Thanks!

  • Replied 8 September 2017, 2:31 pm EST

    I looked into this and see what you mean, the SheetView OpenExcel Method lets you specify a sheet but does not allow you to include ExcelOpenFlags, the FpSpread OpenExcel Method allows you to include ExcelOpenFlags, but doesn't allow you to specify the sheet. I have discussed this with the product manager and he is going to investigate another overload for the SheetView Method to include OpenExcelFlags but in the mean time the easiest way I can see to do what you want is with the FpSpread  OpenExcel Method and once its open with the headers you want, then just remove the sheets you don't want.
Need extra support?

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

Learn More

Forum Channels