private void btnGetText_Click(object sender, EventArgs e) { Excel.Range rng = Globals.ThisAddIn.Application.Range["a1"]; if (url != null) { string[] str = MyGrab.GetContent(url); //提取网抓内容 //string[] strArr =str.Split('_');//分割成数组 rng.ExportDataInSht <string>(str); //输出到Excel单元格 rng.EntireColumn.AutoFit(); //自动调整列宽 } }