Exception calling "Fill" with "1" argument(s): "ERROR [HYT00] Timeout expired"
Can you please guide me on how can I fix the error?
e.g. I have been using following at high level:
## ———- Working with Excel ———- ##
## – Create an Excel Application instance:
## – Create new Workbook and Sheet (Visible = 1 / 0 not visible)
## – Build the Excel column heading:
## – Build column header:
## – Adding the data start in row 2 column 1:
foreach ($rec in $DataSetTable.Rows)
## – Populating columns:
if (!(Test-Path -path "$DirectoryToSave")) #create it if not existing
## – Adjusting columns in the Excel sheet:
## ———- Saving file and Terminating Excel Application ———- ##
## – Saving Excel file – if the file exist do delete then save
if (Test-Path $xlsFile)
Hi, I request you to format the code in the forum which makes other to easily understand your code, below link will help you.
Looks like you are running into a timeout issue. Per the documentation, you have a 30 second timeout, so you can attempt to manipulate the CommandTimeout:
$cmd = New-Object system.Data.Odbc.OdbcCommand($SQL,$conn) $cmd.CommandTimeout = '300'
The documentation also states the value is in seconds, so this would be a 5 minute timeout.
Rob, is on track with the timeout thing, and manipulating the time out could help, but from what you describe, this timeout setting may be just a band aid, as the real issue can be network related or SQL host related.
You, need to evaluate infrastructure (network congestion) / operations (firewall – IDS – IPS change) / host changes (or resource consumptions / over commits) for root cause as needed before trying o determine how much of this timeout you may or may need to address.
Thank you Rob and Postanote!
The script ran today without the timeout error.
Going forward if I face the same issue again, I will follow up with the network team to gather timeout stats.
You must be logged in to reply to this topic.