diff --git a/application/query.class.inc.php b/application/query.class.inc.php
index 5bd4ddbb4f..bc02bd817d 100644
--- a/application/query.class.inc.php
+++ b/application/query.class.inc.php
@@ -94,13 +94,26 @@ class QueryOQL extends Query
{
$sUrl = utils::GetAbsoluteUrlAppRoot().'webservices/export.php?format=spreadsheet&login_mode=basic&query='.$this->GetKey();
$sOql = $this->Get('oql');
- $oSearch = DBObjectSearch::FromOQL($sOql);
- $aParameters = $oSearch->GetQueryParams();
- foreach($aParameters as $sParam => $val)
+ $sMessage = null;
+ try
{
- $sUrl .= '&arg_'.$sParam.'=["'.$sParam.'"]';
+ $oSearch = DBObjectSearch::FromOQL($sOql);
+ $aParameters = $oSearch->GetQueryParams();
+ foreach($aParameters as $sParam => $val)
+ {
+ $sUrl .= '&arg_'.$sParam.'=["'.$sParam.'"]';
+ }
}
- $oPage->p(Dict::S('UI:Query:UrlForExcel').':
');
+ catch (OQLException $e)
+ {
+ $sMessage = '