Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default write two excel sheet

object missing=Missing.Value;
Excel.Application myExcel = new Excel.Application ( ) ;

myExcel.Application.Workbooks.Open(fileName,missin g,missing,missing,missing,
missing,missing,missing,missing,missing,missing,mi ssing,missing);

Excel.Workbook myBook=myExcel.Workbooks[1];
Excel.Sheets sheets=myBook.Worksheets;

for(int currSheet=1; currSheet < 2; currSheet ++)
{
Excel.Worksheet mySheet=(Excel.Worksheet)sheets.get_Item(currSheet );

//write data, eg::
mySheet.Cells[1,1] = "1";
mySheet.Cells[2,1] = "2";

Excel.Range r=mySheet.get_Range(mySheet.Cells[1,1],mySheet.Cells[2,1]);
r.Select(); //wrong when second loop, Why?
}
Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
How to write X Bar in Microsoft Excel Sheet? vikas surani New Users to Excel 2 November 19th 09 02:37 PM
How do I write inclined text in a picture in excel sheet? kailas Excel Worksheet Functions 2 October 4th 08 12:58 AM
how do i write a Algebra formula in excel sheet Saravanan Excel Discussion (Misc queries) 1 October 9th 06 10:47 AM
How do I undo write protected to excel sheet send to floppy disk ron Excel Discussion (Misc queries) 1 March 26th 06 08:55 PM
Write a Shortcut to Open Excel Workbook at a Specific Sheet SidBord Excel Programming 0 June 2nd 04 11:10 PM


All times are GMT +1. The time now is 08:27 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"