insert row
insert row
insert row
insert row
insert row
insert row insert row insert row insert row insert row insert row insert row insert row
insert row insert row
insert row
Go Back  Xtreme Visual Basic Talk > > > insert row


Reply
 
Thread Tools Display Modes
  #1  
Old 03-21-2005, 05:52 AM
Nick_1 Nick_1 is offline
Freshman
 
Join Date: Jan 2005
Posts: 44
Default insert row


hey i cant seem to sort this out (bad day) i need the code to insert a blank row in an excel sheet somthing like
Code:
xlsheet.row.add
also how do i set the file format to a excel 97-2003 workbook in the save as line of my code ?

Last edited by Nick_1; 03-21-2005 at 06:28 AM.
Reply With Quote
  #2  
Old 03-21-2005, 06:41 AM
herilane's Avatar
herilaneinsert row herilane is offline
Unashamed geek

Retired Moderator
* Expert *
 
Join Date: Jul 2003
Location: London, England
Posts: 8,988
Default

Both questions could easily be answered with the help of the macro recorder.

1) xlSheet.Rows(x).Insert

2) I don't have Excel 2003 so I don't have such a format in my file formats list.
Reply With Quote
  #3  
Old 03-21-2005, 07:54 AM
Nick_1 Nick_1 is offline
Freshman
 
Join Date: Jan 2005
Posts: 44
Default

Quote:
Originally Posted by herilane
Both questions could easily be answered with the help of the macro recorder.

1) xlSheet.Rows(x).Insert

2) I don't have Excel 2003 so I don't have such a format in my file formats list.
Thanks for the promt reply however i didn`t think the macro text would work in vb without a lot of tweeking i have a macro done but file format part of my saveas string is blue underlined when in vb.net see below.
the 2003 excel format is the same as 95-97.
Code:
xlapp.activeworkbook.saveas(file,xlExcel9795,)
Reply With Quote
  #4  
Old 03-21-2005, 10:20 AM
herilane's Avatar
herilaneinsert row herilane is offline
Unashamed geek

Retired Moderator
* Expert *
 
Join Date: Jul 2003
Location: London, England
Posts: 8,988
Default

As with all Excel constants, you need to specify where they can be found. So
xlExcel9795
would need to be something like
Excel.xlFileFormats.xlExcel9795
Reply With Quote
  #5  
Old 03-21-2005, 11:39 PM
Nick_1 Nick_1 is offline
Freshman
 
Join Date: Jan 2005
Posts: 44
Default

Thanks Helen worked perfectly.
Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Forum Jump

Advertisement:





Free Publications
The ASP.NET 2.0 Anthology
101 Essential Tips, Tricks & Hacks - Free 156 Page Preview. Learn the most practical features and best approaches for ASP.NET.
subscribe
Programmers Heaven C# School Book -Free 338 Page eBook
The Programmers Heaven C# School book covers the .NET framework and the C# language.
subscribe
Build Your Own ASP.NET 3.5 Web Site Using C# & VB, 3rd Edition - Free 219 Page Preview!
This comprehensive step-by-step guide will help get your database-driven ASP.NET web site up and running in no time..
subscribe
insert row
insert row
insert row insert row
insert row
insert row
insert row insert row insert row insert row insert row insert row insert row
insert row
insert row
 
insert row
insert row
 
-->