$sExcelFile="C:\WindowsPatching_Reference_2016.xlsx" $sCSVFile="C:\temp\$wksname.csv" #$SheetName = "WinA-Test_Thu" # Get COM Object $oExcel = New-Object -ComObject "Excel.Application" # Should Excel be visible? $oExcel.Visible = $true # and open excel file $oExcelDoc = $oExcel.Workbooks.Open($sExcelFile) # Open Worksheet #$oWorkSheet = $oExcelDoc.sheets.item($SheetName) $oWorksheet = $oExcelDoc.Worksheets.item(7) #Get Sheet Name $Name = $oworksheet.name # Activate, show it $oWorksheet.Activate() $oExcelDoc.SaveAs($sCSVFile,[Microsoft.Office.Interop.Excel.XlFileFormat]::xlCSVWindows) $oExcelDoc.Close($false) Start-Sleep 1 # Cleanup COM [System.Runtime.InteropServices.Marshal]::ReleaseComObject($oWorksheet)|out-null $oWorksheet=$null Start-Sleep 1 # Cleanup COM [System.Runtime.InteropServices.Marshal]::ReleaseComObject($oExcelDoc)|out-null $oExcelDoc=$null # Close Excel $oExcel.Quit() Start-Sleep 1 # Cleanup COM [System.Runtime.InteropServices.Marshal]::ReleaseComObject($oExcel)|out-null $oExcel=$null [GC]::Collect() [GC]::WaitForPendingFinalizers()
Experts Exchange always has the answer, or at the least points me in the correct direction! It is like having another employee that is extremely experienced.
When asked, what has been your best career decision?
Deciding to stick with EE.
Being involved with EE helped me to grow personally and professionally.
Connect with Certified Experts to gain insight and support on specific technology challenges including:
We've partnered with two important charities to provide clean water and computer science education to those who need it most. READ MORE