Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 313
Default How to create new sheet in excel using VJ#.Net

Hi,
I need a code to create a new sheet in the visual j sharp. i tried using this code but it does not work.
//Using Excel 9.0 Object library
import Excel.*;

Excel.ApplicationClass xlApp = new Excel.ApplicationClass();
Workbooks books = (Workbook)xlApp.get_Workbooks();
//Adding excel Template
_Workbook book = (_Workbook)books.Add(Excel.Xlsheet.xlWorksheet);
Sheets sheets = (Sheets)book.get_Worksheets();

//Now trying to add sheet
//Here add method takes .Add(Object before,Object after,Object Count, Object Type)
//
Sheets.Add(null,null,null,null);


Could anyone tell me what i need to do to add sheet?

thanks in advance.
Tony




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 create Login & Log out Spread sheet in Excel with automated Attendance sheet marc5354 Excel Worksheet Functions 2 September 21st 10 04:22 PM
Need a to automatically create a new excel from every sheet benny Excel Discussion (Misc queries) 1 January 28th 08 10:35 PM
create report in excel sheet AskExcel Excel Worksheet Functions 3 July 8th 06 07:07 PM
how do I create more than 266 columns in an excel sheet? Tolo Excel Discussion (Misc queries) 3 September 23rd 05 06:55 PM
is there anyway to create a clone of an excel sheet in vba? Daniel Excel Worksheet Functions 2 July 6th 05 09:41 AM


All times are GMT +1. The time now is 08:25 AM.

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"