public static void ToBloomberg(String ticker, String indice) { if (ticker == null || ticker == "") { return; } try { var excelApp = new Microsoft.Office.Interop.Excel.Application(); int nChannel; String connection; if (indice == "GR_EUROPE") { connection = @"<blp-1>" + ticker + "<Equity>MXEU<Index>GR YTD<GO>"; } else if (indice == "GR_USA") { connection = @"<blp-1>" + ticker + "<Equity>MXUSLC<Index>GR YTD<GO>"; } else { connection = @"<blp-1>" + ticker + "<Equity>" + indice + "<GO>"; } nChannel = excelApp.DDEInitiate("winblp", "bbk"); excelApp.DDEExecute(nChannel, connection); excelApp.DDETerminate(nChannel); excelApp.Quit(); } catch (Exception e) { MessageBox.Show(e.ToString()); } }