Skip to content

getting mergeCells count value? #1493

Answered by markocam
markocam asked this question in Q&A
Discussion options

You must be logged in to vote

arr got it

$eFile = "$PSScriptroot\Test.XLSX"
$dTemp = Open-ExcelPackage $eFile

$ws = "sheet1"
$Sheet1 = $dTemp.Workbook.Worksheets["$ws"]
$c = $Sheet1.MergedCells.Count

Write-Host "merged cells count: $c"

Close-ExcelPackage $dTemp -NoSave

Replies: 4 comments 2 replies

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Answer selected by dfinke
Comment options

You must be logged in to vote
2 replies
@markocam
Comment options

@dfinke
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants