public static void RibbonPivotExcel() { var vActivCell = SqlEngine.currExcelApp.ActiveCell; if (vActivCell.ListObject == null) { MessageBox.Show(" Please, select cell from the table", " Refresh error"); return; } In2SqlSvcTool.CurrentTableRecords vCTR = In2SqlSvcTool.getCurrentSql(); if (vCTR.TypeConnection.Contains("ODBC")) { string vSql = RemoveSqlLimit(vActivCell.ListObject.QueryTable.CommandText); createPivotTable(getOdbcNameFromCell(), In2SqlSvcTool.GetHash(vSql), vSql); } if (vCTR.TypeConnection.Contains("CLOUD")) { SqlEngine.currExcelApp.SendKeys("%NVT"); } GetSelectedTab(); }