You can use the Spread 8 COM control in Microsoft Visual Studio 2015 with Microsoft Windows 10. Spread Windows Forms is a .NET control and is a better option; however, you may have older code or projects where you need to use Spread 8 COM.

Use the following steps to create a new project in Visual Studio 2015 and add the Spread 8 COM control.


    1. Select File, New, and then Project in Visual Studio 2015.

      Spread 8 COM and Microsoft Visual Studio 2015
      New Project

    2. Select Windows under the Visual C# or Visual Basic sections. Then select Windows Forms Application. Specify a name and location and then select OK.

      Spread 8 COM and Microsoft Visual Studio 2015
      Windows Forms Application

    3. Right click on the Toolbox and select Choose Items…

      Spread 8 COM and Microsoft Visual Studio 2015
      Add Item

    4. Select Farpoint Spread 8.0 from the COM Components tab. Then select OK.

      Spread 8 COM and Microsoft Visual Studio 2015
      Components

    5. Select Spread and drag it to the form from the Toolbox.


      Spread 8 COM and Microsoft Visual Studio 2015
      Toolbox


      Spread 8 COM and Microsoft Visual Studio 2015
      Form with Spread Control

    6. Select MSDATASRC and stdole references in the Solution Explorer and set Embed Interop Types to False.



      Spread 8 COM and Microsoft Visual Studio 2015
      Reference


      Spread 8 COM and Microsoft Visual Studio 2015
      Reference

    7. Select Project and Properties.


      Spread 8 COM and Microsoft Visual Studio 2015
      Project Properties

    8. Verify that the Prefer 32-bit option is checked under the Build menu.

      Spread 8 COM and Microsoft Visual Studio 2015
      Build Options

    9. Add code and run the project. This code creates multiple headers and adds header text.



C#
<code class="language-csharp">axfpSpread1.MaxCols = 8;
axfpSpread1.MaxRows = 12;
axfpSpread1.ColHeaderRows = 3;
axfpSpread1.RowHeaderCols = 2;
axfpSpread1.AddCellSpan(1, -1000, 8, 1);
axfpSpread1.SetText(1, -1000, "Fiscal Year 2015");
axfpSpread1.AddCellSpan(1, -999, 2, 1);
axfpSpread1.SetText(1, -999, "1st Quarter");
axfpSpread1.AddCellSpan(3, -999, 2, 1);
axfpSpread1.SetText(3, -999, "2nd Quarter");
axfpSpread1.AddCellSpan(5, -999, 2, 1);
axfpSpread1.SetText(5, -999, "3rd Quarter");
axfpSpread1.AddCellSpan(7, -999, 2, 1);
axfpSpread1.SetText(7, -999, "4th Quarter");
axfpSpread1.SetText(1, -998, "East");
axfpSpread1.SetText(2, -998, "West");
axfpSpread1.SetText(3, -998, "East");
axfpSpread1.SetText(4, -998, "West");
axfpSpread1.SetText(5, -998, "East");
axfpSpread1.SetText(6, -998, "West");
axfpSpread1.SetText(7, -998, "East");
axfpSpread1.SetText(8, -998, "West");
axfpSpread1.AddCellSpan(-1000, 1, 1, 12);
axfpSpread1.SetText(-1000, 1, "Store #");

Spread 8 COM and Microsoft Visual Studio 2015
Completed Project