Skip to content
Loading
  • 0
    If you use Spire.XLS, you can copy the data from the range S1:W1000 to clipboard like this
     
    1. [STAThread]  
    2. static void Main(string[] args)  
    3. {  
    4.     //load Excel file  
    5.     Workbook wb = new Workbook();  
    6.     wb.LoadFromFile("data.xlsx");  
    7.     //get the first sheet  
    8.     Worksheet sheet = wb.Worksheets[0];  
    9.     //copy data to clipboard  
    10.     sheet.Range["S1:W1000"].CopyToClipboard();  
    11. }  
    0
  • Ramesh Palanivel
    0
    1. int startColumn = Header.Cells.Column;  
    2.  int startRow = header.Cells.Row + 1;  
    3.  Excel.Range startCell = this.sheet.Cells[startRow, startColumn];  
    4.  int endColumn = startColumn + 1;  
    5.  int endRow = 65536;  
    6.  Excel.Range endCell = this.sheet.Cells[endRow, endColumn];  
    7.  Excel.Range myRange = this.sheet.Range[startCell, endCell];  
    Hi Sumit,
     
    try this,
    0
  • Altaf Ansari
    0
    try This :
     
    1.  Excel.Application aplicacion = new Excel.Application();  
    2.                 //Use Existing Sheet  
    3.                 Excel.Workbook workbook1 = aplicacion.Workbooks.Open("Path/ExcelFile.xlsx");  
    4.   
    5.                 Excel.Worksheet worksheet = (Excel.Worksheet)workbook1.Worksheets.get_Item(1);  
    6.   
    7. Microsoft.Office.Interop.Excel.Range SomeCell = (Excel.Range)worksheet.Cells[1, 10]; 
     
    0