I am wanting to create a script that would basically add the sum of what is in excel and save it as a variable so i can input it somewhere else.
Excel looks like this:
Count | Store_Name |
5 | Store 1 |
10 | Store 2 |
5 | Store 3 |
$filePath ="E:\Extra\Note\Test.xlsx"
$excelObj = New-Object -ComObject Excel.Application
$excelObj.Visible = $false
#open WorkBook
$workBook = $excelObj.Workbooks.Open($filePath)
$workSheet = $workBook.sheets.Item(1)
#Select the range of rows should read
$range= 1
for($i=1;$i-le $range;$i++){
$workSheet.Range("A1:A1").Text
}
This is what i have learned so far, but im sure there are better ways than me copying $worksheet.Range ("A1").Text
for the whole column until 300, and then trying to find out how to add them together.