Midoliy.Office.Interop.Excel 0.0.5

There is a newer version of this package available.
See the version list below for details.
dotnet add package Midoliy.Office.Interop.Excel --version 0.0.5
NuGet\Install-Package Midoliy.Office.Interop.Excel -Version 0.0.5
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="Midoliy.Office.Interop.Excel" Version="0.0.5" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add Midoliy.Office.Interop.Excel --version 0.0.5
#r "nuget: Midoliy.Office.Interop.Excel, 0.0.5"
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
// Install Midoliy.Office.Interop.Excel as a Cake Addin
#addin nuget:?package=Midoliy.Office.Interop.Excel&version=0.0.5

// Install Midoliy.Office.Interop.Excel as a Cake Tool
#tool nuget:?package=Midoliy.Office.Interop.Excel&version=0.0.5

Midoliy.Office.Interop.Excel

このライブラリは Excel COM をより使いやすくするためのラッパーライブラリです。
通常、Excel COM を利用する場合は以下のように煩雑なコードを記述する必要があります。

using System.Runtime.InteropServices;
using Excel = Microsoft.Office.Interop.Excel;

class Program
{
    static void Main(string[] args)
    {
        var app = new Excel.Application();
        try
        {
            var book = app.Workbooks.Add();
            try
            {
                var sheet = book.Sheets[1];
                try
                {
                    var cell = sheet.Range["A1"] as Excel.Range;
                    try
                    {
                        cell.Value = 100;
                    }
                    finally
                    {
                        while (0 < Marshal.ReleaseComObject(cell)) { } 
                    }
                }
                finally
                {
                    while (0 < Marshal.ReleaseComObject(sheet)) { }
                }
            }
            finally
            {
                while (0 < Marshal.ReleaseComObject(book)) { }
            }
        }
        finally
        {
            app.Visible = true;
            while (0 < Marshal.ReleaseComObject(app)) { }
        }
    }
}

Midoliy.Office.Interop.Excel を利用することで以下のように簡潔に記述することが可能となります。

using Midoliy.Office.Interop;

class Program
{
    static void Main(string[] args)
    {
        using (var app = Excel.BlankWorkbook())
        {
            // appのDispose後にExcelを表示する
            app.Visibility = AppVisibility.Visible;

            // パターン(1)
            app.Workbooks(1).Worksheets(1).Cells("A1").Value = 100;

            // パターン(2)
            app[1][1]["A1"].Value = 100;

            // パターン(1) と パターン(2)を複合させても良い
            app[1].Worksheets(1)["A1"].Value = 100;                
        }
    }
}
Product Compatible and additional computed target framework versions.
.NET Framework net40 is compatible.  net403 was computed.  net45 was computed.  net451 was computed.  net452 is compatible.  net46 was computed.  net461 is compatible.  net462 was computed.  net463 was computed.  net47 was computed.  net471 was computed.  net472 is compatible.  net48 is compatible.  net481 was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages (1)

Showing the top 1 NuGet packages that depend on Midoliy.Office.Interop.Excel:

Package Downloads
Fxcel

Excel COM operation tools for F#

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last updated
0.0.6.42 835 8/9/2021
0.0.6.41 326 8/9/2021
0.0.6.40 344 8/9/2021
0.0.6.39 312 8/8/2021
0.0.6.38 342 8/8/2021
0.0.6.37 335 8/8/2021
0.0.6.36 322 8/8/2021
0.0.6.35 322 8/8/2021
0.0.6.34 343 8/8/2021
0.0.6.33 328 8/8/2021
0.0.6.32 302 8/8/2021
0.0.6.31 319 8/8/2021
0.0.6.30 495 7/29/2021
0.0.6.29 410 7/29/2021
0.0.6.28 555 7/29/2021
0.0.6.27 348 7/29/2021
0.0.6.26 352 7/29/2021
0.0.6.25 437 7/29/2021
0.0.6.24 376 7/29/2021
0.0.6.23 370 7/29/2021
0.0.6.22 397 7/29/2021
0.0.6.21 586 7/28/2021
0.0.6.20 457 7/28/2021
0.0.6.19 372 7/28/2021
0.0.6.18 390 7/28/2021
0.0.6.17 494 7/28/2021
0.0.6.16 454 7/27/2021
0.0.6.15 390 7/27/2021
0.0.6.14 797 6/19/2021
0.0.6.13 309 6/19/2021
0.0.6.12 302 6/17/2021
0.0.6.11 337 6/16/2021
0.0.6.10 361 6/16/2021
0.0.6.9 369 6/16/2021
0.0.6.8 441 6/15/2021
0.0.6.7 489 6/13/2021
0.0.6.6 409 6/13/2021
0.0.6.5 327 6/13/2021
0.0.6.4 304 6/13/2021
0.0.6.3 322 6/13/2021
0.0.6.2 322 6/13/2021
0.0.6.1 333 6/13/2021
0.0.6 319 6/12/2021
0.0.5.6 345 5/18/2021
0.0.5.5 513 11/19/2020
0.0.5.4 483 9/28/2020
0.0.5.3 465 9/25/2020
0.0.5.2 507 9/25/2020
0.0.5.1 501 5/10/2020
0.0.5 498 5/10/2020
0.0.4 448 4/24/2020
0.0.3 492 4/20/2020
0.0.2 470 4/19/2020
0.0.1 473 4/19/2020