Create calc file using C#

Hello,
using C# (through VisualStudio) I’d like to make a calc file and write to it, similarly to writing to a text file just a spreadsheet instead.

There’s some info about the ADOL Toolkit, but I couldn’t download it using the related pages I found because they don’t exist anymore.

I found this forum post, but the example webpage refernced in the accepted answer didn’t provide any examples of how to actually make create a file (at least not that I understood).

As an alternative, I looked into creating Excel files but the extension didn’t seem to work (possibly due to not having installed Excel).

So far what I’m looking for (not sure if this is it) are any Visual Studio extensions (preferably that have examples), of how to write to a calc file using C#.

Thanks for any help.

Greetings,

I’m working on that subject the last week and can share some code to start with. Note that you need to download and install the LibreOffice SDK for the assemblies to be referenced in your project, references section

using System;
//
// UNO references needed:
// cli_basetypes, cli_cppuhelper, cli_oootypes.dll, cli_uno, cli_ure, cli_uretypes.
//
using unoidl.com.sun.star.uno;
using unoidl.com.sun.star.lang;
using unoidl.com.sun.star.frame;
using unoidl.com.sun.star.beans;
using unoidl.com.sun.star.sheet;
using unoidl.com.sun.star.container;
using unoidl.com.sun.star.table;
using unoidl.com.sun.star.text;

namespace con_03
{
  class Program
  {
    static void Main (string [] args)
    {
      Console.WriteLine ("Hello Scalc!");

      XComponentContext ctx = uno.util.Bootstrap.bootstrap ();
      XMultiServiceFactory srv_manager = (XMultiServiceFactory)ctx.getServiceManager ();
      XComponentLoader component_loader = (XComponentLoader)srv_manager.createInstance ("com.sun.star.frame.Desktop");
      string url = @"private:factory/scalc";
      XComponent component = component_loader.loadComponentFromURL (url, "_blank", 0, new PropertyValue [0]);

      XSpreadsheetDocument document = (XSpreadsheetDocument)component;
      XSpreadsheets sheets = document.getSheets ();
      XIndexAccess sheets_index = (XIndexAccess)sheets;
      XSpreadsheet sheet = (XSpreadsheet)sheets_index.getByIndex (0).Value;

      XCell c1 = sheet.getCellByPosition (0, 0);
      ((XText)c1).setString ("BlaBla");

      XCell c2 = sheet.getCellByPosition (1, 1);
      c2.setValue (123);
    }
  }
}

Hello and thanks for the reply.
Once I’ve got the SDK downloaded how do I add it to Visual Studio?