Ich habe diesen Code um ein Blatt in einer Excel Arbeitsmappe zu löschen.
#Specify the path to the Excel file and the WorkSheet Name
$FilePath = "C:\Users\tobias\test.xlsx"
$SheetName = "Sheet4"
#Create an Object Excel.Application using Com interface
$objExcel = New-Object -ComObject Excel.Application
#Disable the 'visible' property so the document won't open in excel
$objExcel.Visible = $false
#Set Display alerts as false
$objExcel.displayalerts = $False
#Open the Excel file and save it in $WorkBook
$WorkBook = $objExcel.Workbooks.Open($FilePath)
#Load the WorkSheet 'BuildSpecs'
$WorkSheet = $WorkBook.sheets.item($SheetName)
#Deleting the worksheet
$WorkSheet.Delete()
#Saving the worksheet
$WorkBook.Save()
$WorkBook.close($true)
$objExcel.Quit()
Wie kann ich eine Zeile aus dem Blatt entfernen?