Example: You just asked a thousand systems a million questions. You are ready to check it out...but manually opening an excel file is just too much.
#-------------------------Variables----------------------------
$CsvFile = ("file.csv")
$excel = new-object -comobject Excel.Application
$excel.visible = $True
if (!$(test-path $CsvFile)) {
write-host "File doesn't exist..."
}
else {
$excelfile = $excel.Workbooks.Open($CsvFile)
}
$excel.ActiveSheet.Cells.EntireColumn.AutoFit()
No comments:
Post a Comment