Advertisement
Guest User

Untitled

a guest
Oct 26th, 2016
112
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.84 KB | None | 0 0
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Text;
  5. using Microsoft.Office.Tools.Ribbon;
  6. using Microsoft.Office.Tools.Excel;
  7. using Microsoft.Office.Interop.Excel;
  8.  
  9. namespace ExcelAddIn2
  10. {
  11. public partial class Ribbon1
  12. {
  13.  
  14. private void Ribbon1_Load(object sender, RibbonUIEventArgs e)
  15. {
  16.  
  17. }
  18.  
  19. private void GetRageValues()
  20. {
  21.  
  22. Range range = Globals.ThisAddIn.Application.get_Range("A1", "A3");
  23.  
  24. //to be replaced with database insert
  25. System.Windows.Forms.MessageBox.Show("You Selected" + range.Address);
  26. }
  27.  
  28. private void button1_Click_1(object sender, RibbonControlEventArgs e)
  29. {
  30. GetRageValues();
  31.  
  32. }
  33.  
  34. }
  35. }
  36.  
  37. Microsoft.Office.Interop.Excel.Range SelectedRange = Globals.ThisAddIn.Application.Selection;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement