Tag: 评论

使用PowerShell从Excel文件读取注释

我的search只导致类似的VBA,但我有一个不同的方法,在PowerShell中这个问题。 我是PowerShell的新手,我想读取Excel文件中的所有注释,并将它们保存为CSV文件。 除了阅读评论之外,一切都有效。 评论是com对象。 我如何从COM对象获得实际的评论? 这是相关代码的一个片段。 我不能用invokemember来做,但也许我做错了。 提前致谢。 ForEach ($File in (Get-ChildItem $folder -Include *.xls, *.xlsx, *.xlsm -Recurse)) { $sh=$document.Sheets.Item($i) $comments = $sh.comments foreach ($comment in $comments) { #[System.__ComObject] <— Must get this value | Add-Content -file.csv } } 我也打开其他方法来完成这一点。

Worksheet_change:删除整个列值,在此操作之前识别非空单元格

我有一个工作簿,用于input主表单,主表单中的值根据主表单中“types”列的单元格值复制到2个子表单中。 子表单中的“注释”列中的任何值都将作为注释添加到主表单的相应行中。当子表单中的“注释”列中的值一次性删除时,我想标识在这个动作之前的非空单元格,并删除主表中的相应注释。 目前我已经编写了代码,如果在子表单的“注释”列中添加/删除了一个值,然后在主表单的相应条目中添加/删除注释。 Private Sub Worksheet_Change(ByVal Target As Range) Dim temp As String Dim tem As String With Target If .Count = 1 And .Column = 8 And .Row < 600 Then tem = .Row If Sheets("Parts- input").Cells(tem, 8).Comment Is Nothing Then If Sheets("Pins").Cells(.Row, .Column).Value = "" Then Sheets("Parts- input").Cells(tem, 8).Comment.Delete Else Sheets("Parts- input").Cells(tem, 8).AddComment […]

使用VBA添加注释到excel

给单元格添加评论真的很困难。 我打电话给下面的子 Sub ValidationError(row As Long, column As Integer, ErrorLine As String) Tabelle1.Cells(row, column).Interior.Color = vbYellow Tabelle1.Cells(row, column).AddComment ErrorLine End Sub 但是我总是得到一个1004错误,说“应用程序或对象错误”(这是翻译,原始信息:“Anwendungs-oder objektdefinierter Fehler”) 该子被称为使用 Call ValidationError(8, 9, "Text string") 我究竟做错了什么? 最好