开发者

powershell and indexer property

开发者 https://www.devze.com 2023-01-26 07:01 出处:网络
If an indexer in C# is expressed as: index[1, 1]. How would you express this with powershell? To be more specific, I\'m trying to use EPPlus with Powershell to generate excel documents. However I\'m

If an indexer in C# is expressed as: index[1, 1]. How would you express this with powershell?

To be more specific, I'm trying to use EPPlus with Powershell to generate excel documents. However I'm having a problem select cells using its cell index property.

I posted a thread on Epplus' 开发者_高级运维discussion forum but I'm not entirely sure where to go from there.


WorkBook.Cells is an ExcelRange object that provides access to cell via Indexers.

Indexers are syntactic sugar that don't translate directly to PowerShell, use this instead:

$WorkSheet.Cells.Item(1,1).Value = "Cell 1"
0

精彩评论

暂无评论...
验证码 换一张
取 消