PowerShell批量增加Excel的批注

47次阅读
没有评论
$excel = New-Object -ComObject excel.application
$excel.Visible = $true 
$excel.Workbooks.Open("D:\test.xlsx") 
1..7 | ForEach-Object -Process {$excel.Cells.Item($_,1).comment.text()} 
查看当前的A1-A7的批注
PowerShell批量增加Excel的批注
1..7 | ForEach-Object -Process {$excel.Cells.Item($_,1).comment.text(
$excel.Cells.Item($_,1).comment.text() + "  +Test_Comment")}
加入 "  +Test_Comment"
PowerShell批量增加Excel的批注
PowerShell批量增加Excel的批注
正文完
 
评论(没有评论)