Hi everybody,
I am trying to find out, whether a specific cell in Excel is filled or not.
I am playing around with a little start-script, which writes the starttime to a specific cell into excel.
What I am struggeling with is to test, whether this cell is already filled.
If the cell is filled, I would like to avoid re-filling it with a new value…
(I cannot find something like “test-path” for excel)
function clock()
{
$Time = Get-Date
$global:Zeit = $Time.tostring("HH:mm:ss")
$global:Zeile = $Time.Day+1
$global:Monat = get-date -format MMMM
}
clock
$objexcel=New-Object -ComObject Excel.Application
$workbook=$objexcel.WorkBooks.Open('H:\Arbeitszeit\2023.xlsx')
$worksheet=$workbook.WorkSheets.item($Monat)
$objexcel.Visible= $false
$worksheet.Cells.Item($Zeile,4)=$Zeit
$workbook.Save()
$objexcel.Quit()
any help would be highly appreciated
newbi