$erroractionpreference = “SilentlyContinue”
$a = New-Object -comobject Excel.Application
$a.visible = $True
$b = $a.Workbooks.Add()
$c = $b.Worksheets.Item(1)
$c.Cells.Item(1,1) = “Computer Name”
$c.Cells.Item(1,2) = “OS Version”
$c.Cells.Item(1,3) = “IP vLan”
$c.Cells.Item(1,4) = “Description”
$c.Cells.Item(1,5) = “Model”
$d = $c.UsedRange
$d.Interior.ColorIndex = 37
$d.Font.ColorIndex = 1
$d.Font.Bold = $True
$d.EntireColumn.AutoFit()
$intRow = 2
The above code works but how do I make it create a second workbook (SHEET2)? I've played around with this code but I've yet to have it create a sheet2.