'Powershell, Select one value from excel autofilter
I'm needing help where I wanted powershell to open up excel select a value from the filter, then save and e-mail. All the other stuff is easy and works just fine, but I can't find the correct script to select a vlaue from an filter in excel? The filter is already applied, I just need it to select it.
$localpath ="C:\PowerShellScripts\"
$localfilename = "Q:\Dynamic Reports\test.xlsx"
$xl = new-object -c excel.application
#Start Logging
Start-Transcript -Path $errorlog -Append
Add-Type -AssemblyName System.Windows.Forms
set-itemProperty -Path $localfilename -Name IsReadOnly -Value $false
$app = New-Object -comobject Excel.Application
$app.Visible = $True
set-itemProperty -Path $localfilename -Name IsReadOnly -Value $false
$wb = $app.Workbooks.Open("Q:\Dynamic Reports\test.xlsx")
Set-Clipboard
Start-Sleep 10
$wb.Name
$wb.RefreshAll()
Start-Sleep 50
$ws = $wb.Sheets.Item("Shortlife")
$wb.Save()
$wb.Close()
$app.Quit()
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|
