Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
How to get actual sheet in my workbook?
Hello all, i am trying to developer a excel addin with Visual Studio
2008/Office 2007 and C#! my question is: I create a simple Ribbon control with my button, and in the Button click i want to get the worksheet [0] (fist) and read some cells to paste this values in word.. my i have no ideia how to do this, can anybody help me? Tools: visual studio 2008, Office addin development Language: C# Office Version: 2007 |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
How to get actual sheet in my workbook?
You may refer
http://support.microsoft.com/kb/302084 To read values you can either use variable = Range("A" & n) where A is the column name and n is the row number OR variable = Cells(x,y) where x is the row number and y is the column number -- If this post helps click Yes --------------- Jacob Skaria "Raphael Saccomani" wrote: Hello all, i am trying to developer a excel addin with Visual Studio 2008/Office 2007 and C#! my question is: I create a simple Ribbon control with my button, and in the Button click i want to get the worksheet [0] (fist) and read some cells to paste this values in word.. my i have no ideia how to do this, can anybody help me? Tools: visual studio 2008, Office addin development Language: C# Office Version: 2007 |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
How to get actual sheet in my workbook?
http://www.codeproject.com/KB/cs/Exc...ion_in_C_.aspx
If this post helps click Yes --------------- Jacob Skaria "Raphael Saccomani" wrote: Hello all, i am trying to developer a excel addin with Visual Studio 2008/Office 2007 and C#! my question is: I create a simple Ribbon control with my button, and in the Button click i want to get the worksheet [0] (fist) and read some cells to paste this values in word.. my i have no ideia how to do this, can anybody help me? Tools: visual studio 2008, Office addin development Language: C# Office Version: 2007 |
#4
Posted to microsoft.public.excel.programming
|
|||
|
|||
How to get actual sheet in my workbook?
hello again,
this sample works fine! http://support.microsoft.com/default.aspx/kb/302084 but generate a new Excel Application Work Book, i need to get actual opened workbook. and the codeproject code we need the workbook fullpath to open! how to get the full path or actual excel.application class?? "Jacob Skaria" wrote: http://www.codeproject.com/KB/cs/Exc...ion_in_C_.aspx If this post helps click Yes --------------- Jacob Skaria "Raphael Saccomani" wrote: Hello all, i am trying to developer a excel addin with Visual Studio 2008/Office 2007 and C#! my question is: I create a simple Ribbon control with my button, and in the Button click i want to get the worksheet [0] (fist) and read some cells to paste this values in word.. my i have no ideia how to do this, can anybody help me? Tools: visual studio 2008, Office addin development Language: C# Office Version: 2007 |
#5
Posted to microsoft.public.excel.programming
|
|||
|
|||
How to get actual sheet in my workbook?
Hello Guys!
I solved my problem! :) In the Excel Addin class have the method this.Initialize(); i go to definition and see that he give the Excel Application class: this.GetHostItem<Microsoft.Office.Interop.Excel.Ap plication(typeof(Microsoft.Office.Interop.Excel.A pplication), "Application"); then i create a simple static class that have one member type of Microsoft.Office.Interop.Excel.Application and i can use this class in my ribbon control: private void button1_Click(object sender, RibbonControlEventArgs e) { Excel.Application oXL; Excel._Workbook oWB; Excel._Worksheet workSheet; Excel.Range oRng; try { oXL = Functions.m_app; //Get actual workbook. oWB = Functions.m_app.ActiveWorkbook; workSheet = (Excel._Worksheet)oWB.ActiveSheet; workSheet.Cells[1, 1]="funcioneiiii"; //MessageBox.Show(); MessageBox.Show(workSheet.get_Range("A1", "A1").Text.ToString()); } catch (Exception theException) { String errorMessage; errorMessage = "Error: "; errorMessage = String.Concat(errorMessage, theException.Message); errorMessage = String.Concat(errorMessage, " Line: "); errorMessage = String.Concat(errorMessage, theException.Source); MessageBox.Show(errorMessage, "Error"); } } thanks all for help! :) God Bless! "Jacob Skaria" wrote: http://www.codeproject.com/KB/cs/Exc...ion_in_C_.aspx If this post helps click Yes --------------- Jacob Skaria "Raphael Saccomani" wrote: Hello all, i am trying to developer a excel addin with Visual Studio 2008/Office 2007 and C#! my question is: I create a simple Ribbon control with my button, and in the Button click i want to get the worksheet [0] (fist) and read some cells to paste this values in word.. my i have no ideia how to do this, can anybody help me? Tools: visual studio 2008, Office addin development Language: C# Office Version: 2007 |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Why is the actual calculation different from actual sample | Excel Discussion (Misc queries) | |||
How do I print sheet , with actual file save date in footer? | Excel Worksheet Functions | |||
need macro to call a workbook w/o the actual name of the workbook | Excel Programming | |||
Select sheet tabs in workbook & save to separate workbook files | Excel Worksheet Functions | |||
projected cash flow and actual on same sheet | Excel Discussion (Misc queries) |