I'm working with an excel script that will write to the end of an excel file... This is what I have so far: $oExcel = ObjCreate("Excel.Application") $oExcel.Visible = True $workbook=$oExcel.Workbooks.Open("\\sovplafpsop1\docs\SALPP\MNGR\03-MIS\01-Call Matrix\04 KPIs Daily Dashboard by Agent\This Month\02-Input File\Input File - test.xlsx") With $workbook $test= .Cells(.Rows.Count, "B").End(-4162).Row MsgBox(0,"",$test) EndWith $oExcel.Quit() I've tried a number of variations of $test, such