Reputation: 904
A number of Excel files that need to be opened have a problem, they only consist of an .xml file with the table, missing some other files that are usually in the .xlsx container. When opening a file like this in Excel, I get this message:
All I need to do here is press Enter and the file loads.
I need to open a bunch of these files from a Powershell script, how can I suprpress this message?
Currently, the workbooks are opened like this:
$destExc = new-object -ComObject Excel.Application;
$bulkBook = $destExc.Workbooks.Open($bulkXMLList[$i].FullName)
Which prompts said message, after which the script continues.
Upvotes: 1
Views: 2398
Reputation:
Did you try:
$Excel = New-Object -ComObject Excel.Application
$Excel.DisplayAlerts = $False
Upvotes: 3