I have the following code which inserts a row below the row A1000 in my excel file. How could I modify this to insert a row above the last row (will be different each time).
$xlShiftDown = -4121
$File = Get-ChildItem C:\Test.xls
$XL = New-Object -ComObject Excel.Application
$WB = $XL.Workbooks.Open($File.Fullname)
$XL.Visible = $true
$Sheet = $WB.Worksheets.Item('clients')
$objRange = $XL.Range("A1000").EntireRow
[void]$objRange.Insert($xlShiftDown)