Midoliy.Office.Interop.Excel 0.0.6.42

.NET 5.0 .NET Framework 4.0
dotnet add package Midoliy.Office.Interop.Excel --version 0.0.6.42
NuGet\Install-Package Midoliy.Office.Interop.Excel -Version 0.0.6.42
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.6.42" />
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.6.42
#r "nuget: Midoliy.Office.Interop.Excel, 0.0.6.42"
#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.6.42

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

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 Versions
.NET net5.0 net5.0-windows net6.0 net6.0-android net6.0-ios net6.0-maccatalyst net6.0-macos net6.0-tvos net6.0-windows net7.0 net7.0-android net7.0-ios net7.0-maccatalyst net7.0-macos net7.0-tvos net7.0-windows
.NET Framework net40 net403 net45 net451 net452 net46 net461 net462 net463 net47 net471 net472 net48 net481
Compatible target framework(s)
Additional computed target framework(s)
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 548 8/9/2021
0.0.6.41 229 8/9/2021
0.0.6.40 245 8/9/2021
0.0.6.39 224 8/8/2021
0.0.6.38 240 8/8/2021
0.0.6.37 240 8/8/2021
0.0.6.36 237 8/8/2021
0.0.6.35 237 8/8/2021
0.0.6.34 241 8/8/2021
0.0.6.33 220 8/8/2021
0.0.6.32 221 8/8/2021
0.0.6.31 220 8/8/2021
0.0.6.30 373 7/29/2021
0.0.6.29 305 7/29/2021
0.0.6.28 415 7/29/2021
0.0.6.27 267 7/29/2021
0.0.6.26 254 7/29/2021
0.0.6.25 335 7/29/2021
0.0.6.24 285 7/29/2021
0.0.6.23 271 7/29/2021
0.0.6.22 295 7/29/2021
0.0.6.21 448 7/28/2021
0.0.6.20 338 7/28/2021
0.0.6.19 277 7/28/2021
0.0.6.18 287 7/28/2021
0.0.6.17 373 7/28/2021
0.0.6.16 345 7/27/2021
0.0.6.15 301 7/27/2021
0.0.6.14 622 6/19/2021
0.0.6.13 237 6/19/2021
0.0.6.12 224 6/17/2021
0.0.6.11 244 6/16/2021
0.0.6.10 264 6/16/2021
0.0.6.9 265 6/16/2021
0.0.6.8 314 6/15/2021
0.0.6.7 348 6/13/2021
0.0.6.6 291 6/13/2021
0.0.6.5 236 6/13/2021
0.0.6.4 227 6/13/2021
0.0.6.3 233 6/13/2021
0.0.6.2 237 6/13/2021
0.0.6.1 229 6/13/2021
0.0.6 234 6/12/2021
0.0.5.6 259 5/18/2021
0.0.5.5 412 11/19/2020
0.0.5.4 375 9/28/2020
0.0.5.3 367 9/25/2020
0.0.5.2 392 9/25/2020
0.0.5.1 395 5/10/2020
0.0.5 394 5/10/2020
0.0.4 351 4/24/2020
0.0.3 384 4/20/2020
0.0.2 374 4/19/2020
0.0.1 373 4/19/2020