c# - Adding buttons to spreadsheets in .NET (VSTO) -


Using VSTO or some related technique, is it possible to programmatically embed a button in the cell of an Excel worksheet, and it is possible to configure it.

thanks.

With a VSTO document optimization (i.e., the workbook is attached with a netbook) Add and remove worksheets control over runtime. This idea is shown in the following code:

  public partial class sheet 1 {private zero letter 1} startup (object sender, System.EventArgs e) {var button = this.Controls.AddButton (10, 10, 50, 50, "My Button"); button. Text = "my button"; button. Click = New EventHandler (button); } Click the Zero Button (Object Sender, EventsErgus E) {Message Box. Show ("I was clicked!"); }  

You can dynamically control documents through the VSTO add-in, using code with these lines (thanks to the people on it):

  var workSheet = (Excel.Worksheet) sheet; Var vstoSheet = workSheet.GetVstoObject (); Var button = vstoSheet.Controls.AddButton (50, 50, 100, 50, "Test"); button. Text = "dynamic button!";  

Check for more information


Comments

Popular posts from this blog

windows - Heroku throws SQLITE3 Read only exception -

lex - Building a lexical Analyzer in Java -

python - rename keys in a dictionary -