473,385 Members | 1,782 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

Automating formatting of Excel

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
Nov 20 '05 #1
2 1427
* "=?Utf-8?B?QmFncHVzcw==?=" <Ba*****@discussions.microsoft.com> 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/>
Nov 20 '05 #2
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==?=" <Ba*****@discussions.microsoft.com> 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/>

Nov 20 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

163
by: Shiperton Henethe | last post by:
Hi Know any good utilities to help me strip out the tags that Microsoft Excel 2002 leaved behind when you try and export an HTML format file? This is driving me NUTS. And really makes me...
0
by: Nick Carter | last post by:
The following C# lines of code work fine with Excel 2000:- ExcelApplication excelApplication = new Excel.Application(); ExcelWorkbook excelWorkbook =...
0
by: Laurence | last post by:
Hi Folks hope someone can help me out with this wee problem. I'm automating Excel from A2K and want to put a solid black border around a range of cells. I've tried using this: ...
22
by: Howard Kaikow | last post by:
There's a significant problem in automating Excel from VB .NET. Reminds me of a problem I encountered almost 3 years ago that was caused by the Norton Auntie Virus Office plug-in. Can anybody...
0
by: David Caissie | last post by:
I am trying to automate a Vb.net chart using the excel COM object. The problem occurs when trying to run the code in different systems. It is working fine under one of my computers but once i move...
7
by: Middletree | last post by:
I am trying to display dates in a spreadsheet, but the dates need to be in a format that will allow them to be sorted in Excel. The datatype in the SQL Server database is datetime. In this case, I...
3
by: saragoesnuts | last post by:
I have a program that automates to Excel with information in tables. I want to add charts to the excel file (pie charts, bar charts, etc). Is this possible?
7
by: christery | last post by:
Anyone got a clue to why ther is a T between date and time in the "formatted for sorting" or whatewer they call it, and a Z at the end after seconds- got it fixed for my cobol programmer by...
10
by: afromanam | last post by:
Regards, Please help What I'm trying to do is this: (and I can't use reports since I must export to Excel) I export some queries to different tabs in an excel workbook I then loop through...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.