Cellmate は、Microsoft Excel のワークブックを処理するための PowerShell モジュール です。
- Windows PowerShell 5.1
- .NET Framework 4.8
- Microsoft Excel
PowerShell 6 および .NET Core は、この PowerShell モジュールではサポートされていないことに注意してください。
配布用の zip ファイルの最新の安定バージョンは、このリポジトリの Release ページからダウンロードできます。
- アクティブな PowerShell セッションが存在する場合は閉じます。
- ダウンロードした zip ファイル
Cellmate-<バージョン>.zipを解凍します。 - 解凍した
Cellmateディレクトリを、アカウントの\Users\<ユーザー名>\Documents\WindowsPowerShell\Modulesにコピーします。 結果のディレクトリは\Users\<ユーザー名>\Documents\WindowsPowerShell\Modules\Cellmate\<バージョン>になります。
このセクションでは、例として PowerShell スクリプトを示します。
merge-books.ps1
Import-Module Cellmate
$VerbosePreference = "continue"
$books = "book1.xlsx", "book2.xlsx", "book3.xlsx"
Get-Item $books |
Import-Workbook |
Merge-Workbook -As Pdf -PageNumber Right "target.pdf" |
Out-Nullarchive-books.ps1
Import-Module Cellmate
$VerbosePreference = "continue"
$books = "book1.xlsx", "book2.xlsx", "book3.xlsx"
Get-Item $books |
Import-Workbook |
Compress-Workbook "target.zip" |
Out-Null| 名前 | 説明 |
|---|---|
| Compress-Workbook | 1つ以上のワークブックを含む ZIP アーカイブを作成します。 |
| Export-Workbook | ワークブックをファイルに保存します。 |
| Import-Workbook | 指定されたパスからワークブックを読み込みます。 |
| Merge-Workbook | 1つ以上のワークブックを PDF ファイルに結合します。 |
| Remove-HiddenWorksheet | 指定されたワークブック内のすべての非表示のワークシートを削除します。 |
Copyright 2020-2024 the original author or authors. All rights reserved.
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this product except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0