This may work for you: how-do-i-put-the-focus-on-a-modal-dialog-box-using-powershell
Powershell- Excel refresh credential window
Hello. I've seen a few questions about this placed since 2016, but no answers.
I'm updating an excel spreadsheet with the .refresh command through a powershell script. This pulls up the modal window in Excel prompting for credentials.
The credentials are included in the query, so all I really need to do is press enter twice. However, my script doesn't proceed past the .refresh until these modal windows have been dealt with.
I've tried activating the window and sending ~ signals, but since it hangs at the .refresh that doesn't do much good.
Do you have any ideas about how to make these windows proceed?
3 answers
Sort by: Most helpful
-
-
Ian Xue 36,661 Reputation points Microsoft Vendor
2020-08-31T08:02:31.703+00:00 Hi,
For developer questions involving Microsoft Excel, you could ask the experts in the dedicate Excel for Developers forum here
https://social.msdn.microsoft.com/Forums/office/en-US/home?forum=exceldev
Best Regards,Ian
Please remember to "Accept Answer" and upvote if the reply is helpful.
-
Trevor 1 Reputation point
2020-09-09T14:59:10.583+00:00 turns out setting
$objExcel.DisplayAlerts = $false
automatically proceeds with the default option for alerts, rather then just not dispalying them. Script works fabulously.
Thank you for your time.