I need to delete rows from the excel file that do not contain this “%” character.
My code:
$excel = new-object -com Excel.Application
$workbook = $excel.Workbooks.Open($file)
$sheet = $workbook.Sheets.Item('TDSheet')
while( ($sheet.Cells.Item(1,1).Value() -NotLike "%")) {[void]$sheet.Cells.Item(1,1).EntireRow.Delete()}
$workbook.Close($true)
$excel.Quit()
[Runtime.Interopservices.Marshal]::ReleaseComObject($excel)````
Why?
New contributor
Adda Dark is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
1