← Share another text

Shared on Droptext

Untitled text

Posted on 2026-11-1020 views
$p = "C:\Users\Acer\Desktop\ttt.xlsx" Add-Type -AssemblyName System.IO.Compression.FileSystem $z = [IO.Compression.ZipFile]::OpenRead($p) $e = $z.GetEntry("xl/worksheets/sheet3.xml") $r = [IO.StreamReader]::new($e.Open()) [xml]$x = $r.ReadToEnd() $r.Close() foreach ($c in $x.SelectNodes("//*[local-name()='c']")) { $addr = $c.GetAttribute("r") if ($addr -match '^A([2-9]|[1-4][0-9]|5[0-3])$') { $v = $c.SelectSingleNode("./*[local-name()='v']") $f = $c.SelectSingleNode("./*[local-name()='f']") [PSCustomObject]@{ Cell = $addr Value = if ($v) {$v.InnerText} else {""} Formula = if ($f) {$f.InnerText} else {""} StyleID = $c.GetAttribute("s") } } } | Format-Table -AutoSize $z.Dispose()