Created
August 14, 2023 18:50
-
-
Save Anas-jaf/7e244a85fba381fb083e35d39758af1e to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Create a new Excel Application object | |
$excelApp = New-Object -ComObject Excel.Application | |
# Set visibility to true (to make Excel visible) | |
$excelApp.Visible = $true | |
# Get a list of all Excel files in the current folder | |
$excelFiles = Get-ChildItem -Path . -Filter *.xlsx | |
# Loop through the list and open each Excel file | |
foreach ($file in $excelFiles) { | |
$workbook = $excelApp.Workbooks.Open($file.FullName) | |
} | |
# When you're done, you can close Excel | |
#$excelApp.Quit() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment