Powershell- Excel refresh credential window

Trevor 1 Reputation point
2020-08-29T14:32:24.72+00:00

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?

Windows for business Windows Server User experience PowerShell
{count} votes

3 answers

Sort by: Most helpful
  1. Rich Matheisen 47,901 Reputation points
    2020-08-29T15:03:56.763+00:00

  2. Anonymous
    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.


  3. 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.

    0 comments No comments

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.