C#Excel 2013插件,将值写入所选单元格
试图在Excel 2013中向当前活动的单元格写入string,我正在使用Visual Studio 2013 C#创build一个Office加载项。
我可以到达我可以在Windows窗体窗口中的当前选定单元格中获取值的部分,但是我无法将其写回Excel。
Excel.Range currentSelectedCell = Globals.ThisWorkbook.Application.ActiveCell; //output to an object object cellValue = currentSelectedCell.Value; //convert object to a string that can be displayed Convert.ToInt32(cellValue); //finally display the string inside a textbox myTextbox.Text = cellValue.ToString(); // how to get myTextbox.Text to> object to> Globals.ThisWorkbook.Application.ActiveCell ?
欢迎任何帮助。
几乎相同,你得到的价值:
Excel.Range currentSelectedCell = Globals.ThisWorkbook.Application.ActiveCell; currentSelectedCell.Value = myTextbox.Text;