<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>C#でExcelを読み込んで操作する方法を公開｜C# Excel操作テクニック.NET &#187; 動的クラス</title>
	<atom:link href="http://excelcsharp.lance40.com/tag/tag-douteki/feed" rel="self" type="application/rss+xml" />
	<link>http://excelcsharp.lance40.com</link>
	<description>メソッドに貼り付けるだけで機能するソースコードを多数用意しています。</description>
	<lastBuildDate>Sun, 08 Nov 2015 04:41:39 +0000</lastBuildDate>
	<language>ja</language>
		<sy:updatePeriod>hourly</sy:updatePeriod>
		<sy:updateFrequency>1</sy:updateFrequency>
	<generator>https://wordpress.org/?v=3.7.41</generator>
	<item>
		<title>クラスを作成する</title>
		<link>http://excelcsharp.lance40.com/class.html</link>
		<comments>http://excelcsharp.lance40.com/class.html#comments</comments>
		<pubDate>Tue, 19 Nov 2013 13:03:12 +0000</pubDate>
		<dc:creator><![CDATA[Janga]]></dc:creator>
				<category><![CDATA[Excel操作クラス]]></category>
		<category><![CDATA[クラス作成]]></category>
		<category><![CDATA[動的クラス]]></category>

		<guid isPermaLink="false">http://excelcsharp.lance40.com/?p=73</guid>
		<description><![CDATA[このページでは、メソッドを登録するためのクラスを作成します。 クラス名はExcelManagerとなってますので、お好きな名前に変えて使用してください。 &#160; &#160; このクラスは、Excelファイルの1シ [&#8230;]]]></description>
				<content:encoded><![CDATA[<p>このページでは、メソッドを登録するためのクラスを作成します。</p>
<p>クラス名はExcelManagerとなってますので、お好きな名前に変えて使用してください。</p>
<p>&nbsp;</p>
<pre class="brush: csharp; title: ; notranslate">

using Microsoft.Office.Interop.Excel;

    class ExcelManager : IDisposable
    {
        // Excel操作用オブジェクト
        private Application xlApp = null;
        private Workbooks xlBooks = null;
        private Workbook xlBook = null;
        private Sheets xlSheets = null;
        private Worksheet xlSheet = null;

        // ------------------------------------------------------
        // 　コンストラクタ／デストラクタ・プロパティ・メソッド　
        // ------------------------------------------------------

    }

</pre>
<p>&nbsp;</p>
<p>このクラスは、Excelファイルの1シートに対して様々な操作ができるように定義するクラスですので、クラス全体が参照できる変数としてExcelアプリケーション～WorkSheetまでを定義します。</p>
<p>また、VBやC#でコーディングをする際、私はUsing～を多用するので、最後にリソースの解放処理（Dispose）が必ず実行されるように、IDsiposableを実装しています。</p>
<p>&nbsp;</p>
<p>COMオブジェクトの解放について、もうすこし詳しく知りたい方は「「「こちら」」」のページをご覧ください。</p>
<p>&nbsp;</p>
<p>また、面倒なCOMオブジェクトの解放処理を簡略化するためのメソッドも「「「こちら」」」で公開していますので、よかったらあわせてご覧ください。</p>
<p>&nbsp;</p>
]]></content:encoded>
			<wfw:commentRss>http://excelcsharp.lance40.com/class.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
