Is it possible to embed VBA Code inside of a Powershell script so when the PS Script is run it automatically runs the VBA code?
I have the below Powershell code to open the most recently created file and then I want to apply VBA code to the file that was open automatically without any user input, is that possible?
Thanks in advance!!
I have the below Powershell code to open the most recently created file and then I want to apply VBA code to the file that was open automatically without any user input, is that possible?
Thanks in advance!!
Code:
# start Excel
$excel = New-Object -comobject Excel.Application
# Enable the 'visible' property so the document will open in excel
$excel.Visible = $true
$FilePath = Get-ChildItem '\\SHARED\software\Papyru\ECMS\ActiveTasks\' -recurse -File |
Sort-Object -Property CreationTime -Descending | Select-Object -First 1 | Invoke-Item