PC Review


Reply
Thread Tools Rate Thread

Automating formatting of Excel

 
 
=?Utf-8?B?QmFncHVzcw==?=
Guest
Posts: n/a
 
      16th Jul 2004
Can anyone help me?

I am using VB.NET to output data to an Excel 2002 spreadsheet, this works fine.
I would like to know how to change the sheet names and output to a named worksheet and add/remove a named worksheet
Also if possible I would like to subtotal the data on the worksheet.

I can do all this in VBA but for the life of me can't do it in VB, please help.
--
All advice greatfully received
 
Reply With Quote
 
 
 
 
Herfried K. Wagner [MVP]
Guest
Posts: n/a
 
      16th Jul 2004
* "=?Utf-8?B?QmFncHVzcw==?=" <(E-Mail Removed)> scripsit:
> I am using VB.NET to output data to an Excel 2002 spreadsheet, this works fine.
> I would like to know how to change the sheet names and output to a named worksheet and add/remove a named worksheet
> Also if possible I would like to subtotal the data on the worksheet.
>
> I can do all this in VBA but for the life of me can't do it in VB, please help.


I doubt that there is a big difference between how to do that in VBA and
via Excel automation. How would you have done it in VBA?

--
Herfried K. Wagner [MVP]
<URL:http://dotnet.mvps.org/>
 
Reply With Quote
 
=?Utf-8?B?QmFncHVzcw==?=
Guest
Posts: n/a
 
      16th Jul 2004
Thanks for the quick response.

My VBA code looks lik this;

Sheets("Sheet1").Select
Selection.Subtotal GroupBy:=4, Function:=xlSum, TotalList:=Array(6, 7), _
Replace:=True, PageBreaks:=False, SummaryBelowData:=True
ActiveSheet.Outline.ShowLevels RowLevels:=2

How can I get VB to do this for me?
--
All advice greatfully received


"Herfried K. Wagner [MVP]" wrote:

> * "=?Utf-8?B?QmFncHVzcw==?=" <(E-Mail Removed)> scripsit:
> > I am using VB.NET to output data to an Excel 2002 spreadsheet, this works fine.
> > I would like to know how to change the sheet names and output to a named worksheet and add/remove a named worksheet
> > Also if possible I would like to subtotal the data on the worksheet.
> >
> > I can do all this in VBA but for the life of me can't do it in VB, please help.

>
> I doubt that there is a big difference between how to do that in VBA and
> via Excel automation. How would you have done it in VBA?
>
> --
> Herfried K. Wagner [MVP]
> <URL:http://dotnet.mvps.org/>
>

 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

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 On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Guidance on automating the creation of Excel files from Excel LetMeDoIt Microsoft Excel Programming 1 20th Jul 2007 07:23 AM
Can't edit Excel worksheet with picture when automating Excel =?Utf-8?B?U3R1bXBpYW5h?= Microsoft Excel Programming 0 9th Nov 2005 01:23 AM
Re: Automating document formatting Jonathan West Microsoft Word Document Management 0 27th Jul 2004 11:41 PM
Automating the creation and formatting of tables =?Utf-8?B?RGFyeWw=?= Microsoft Word Document Management 1 20th May 2004 10:54 PM
Automating Excel WorkBook With C# Suppress Excel Message Boxes Possible? unemotionalhumanoid Microsoft Excel Programming 1 28th Aug 2003 02:03 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 09:38 PM.