by TimT at 2013-04-15 15:18:50
Hi there, this is a NOOB alert. I am fairly new to PS, but used to script quite a bit.by DonJ at 2013-04-15 15:22:27
If you would please direct me to the forum for Excel. I have a script (see below) that I need help on. After opening the Excel file, a popup will come up asking weather or nto you want to update the file. I do want to, but cannot find a way to automate that. It would occur where line 9 is.
Thanks! Any help is greatly appreciated!
Tim
$excel = new-object -comobject excel.application
$Excel.Visible = $False
$Excel.DisplayAlerts = $FALSE
$excelFiles = Get-ChildItem -Path "\earth\Reviewed Loans" -Include *.xls, *.xlsm -Recurse
Foreach($file in $excelFiles)
{
$workbook = $excel.workbooks.open($file.fullname)
$workbook.save()
$workbook.close()
}
$excel.quit()
Please see rule #3, above :).by TimT at 2013-04-15 15:49:48
Also, rule #1.
We don’t have a forum for Excel, and it can - as you see - be very complicated to work with. Can you attach a screen shot showing the popup in question? And also, can you identify which line of your script is line 9? The Close() method?
Thank you again!by DonJ at 2013-04-15 15:52:25
Line #9 would be the blank line right above the ‘$workbook.save()’ line.
The attached file is a screen shot I get when I run it. It is the same dialog box as if the excel program was showing behind it.
I can hit the ‘u’ key each time, but I have over 500 files to process.
Again - any help is appreciated.
Ah. Yeah, no way to automate that. Not that I ever found. Look into AutoIt - it’s a scripting language specifically for automating GUI stuff like this.