473,699 Members | 2,518 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

How to insert Excel Worksheet Name using Automation in VB Dot Net??

Hi
In my VB Dot Net program, I'm using Automation to call Excel worksheet to do
some insert some data.

I have rename my worksheet to a name. eg. "ABC".

How do I insert the worksheet name & Page No to the Footer so that when I
print the worksheet, the name of the worksheet and page number will be
printed out as well?

Regards
Vanessa
Nov 19 '05 #1
8 9067
Hello,

"Vanessa" <va*****@eclini c.com.sg> schrieb:
In my VB Dot Net program, I'm using Automation to call
Excel worksheet to do some insert some data.

I have rename my worksheet to a name. eg. "ABC".

How do I insert the worksheet name & Page No to the
Footer so that when I print the worksheet, the name of
the worksheet and page number will be
printed out as well?


I think the Excel programmers can help you:

news://news.microsoft.com/microsoft....el.programming

Regards,
Herfried K. Wagner
--
MVP · VB Classic, VB .NET
http://www.mvps.org/dotnet

Nov 19 '05 #2

"Herfried K. Wagner [MVP]" <hi*******@m.ac tivevb.de> wrote in message
news:%2******** ********@TK2MSF TNGP09.phx.gbl. ..
Hello,

"Vanessa" <va*****@eclini c.com.sg> schrieb:
In my VB Dot Net program, I'm using Automation to call
Excel worksheet to do some insert some data.

I have rename my worksheet to a name. eg. "ABC".

How do I insert the worksheet name & Page No to the
Footer so that when I print the worksheet, the name of
the worksheet and page number will be
printed out as well?


I think the Excel programmers can help you:

news://news.microsoft.com/microsoft....el.programming

Regards,
Herfried K. Wagner
--
MVP · VB Classic, VB .NET
http://www.mvps.org/dotnet

Nov 19 '05 #3
Hello,

"Vanessa" <va*****@eclini c.com.sg> wrote:
[Nothing new]

???

Regards,
Herfried K. Wagner
--
MVP · VB Classic, VB .NET
http://www.mvps.org/dotnet
Nov 19 '05 #4
Vanessa,

This code will put "Page #" in the right footer and the sheet tab name in
the center footer

With ActiveSheet.Pag eSetup
.LeftFooter = "Page & &P"
.CenterFooter = "&A"
End With

You can use the macro Recorder to get other code. But beware that the code
I got for PageSetup was 32 lines and I had to edit it down to 4 lines. This
edit is especially important in this case since PageSetup is a very slow
procedure and bogs down your code.

The other way is to just manually go into PageSetup and set it up.
--
sb
"Vanessa" <va*****@eclini c.com.sg> wrote in message
news:ek******** ******@TK2MSFTN GP09.phx.gbl...

"Herfried K. Wagner [MVP]" <hi*******@m.ac tivevb.de> wrote in message
news:%2******** ********@TK2MSF TNGP09.phx.gbl. ..
Hello,

"Vanessa" <va*****@eclini c.com.sg> schrieb:
In my VB Dot Net program, I'm using Automation to call
Excel worksheet to do some insert some data.

I have rename my worksheet to a name. eg. "ABC".

How do I insert the worksheet name & Page No to the
Footer so that when I print the worksheet, the name of
the worksheet and page number will be
printed out as well?


I think the Excel programmers can help you:

news://news.microsoft.com/microsoft....el.programming

Regards,
Herfried K. Wagner
--
MVP · VB Classic, VB .NET
http://www.mvps.org/dotnet


Nov 19 '05 #5
Hello,

"Cor" <no*@non.com> schrieb:
You see what I did mean with Corina :-)


I do not really understand what you mean...

Regards,
Herfried K. Wagner
--
MVP · VB Classic, VB .NET
http://www.mvps.org/dotnet
Nov 20 '05 #6
Cor
Herr Herfried,
Do you know what is better JavaScript or VB6 I want to try that on my
Asp.net server.
Corina
Nov 20 '05 #7
Cor
I sometimes get a slight feeling that the best way to get an answer in this
newsgroup is to use a womans name, does not matter if it is
Javasript, Excel, VB2, Asp.net etc. etc.

Of course for real VB.net questions everybody gets a nice answer man or
woman.

:-)
Nov 20 '05 #8
Hello,

"Cor" <no*@non.com> wrote:
And I do not mean you Herfried


LOL

Regards,
Herfried K. Wagner
--
MVP · VB Classic, VB .NET
http://www.mvps.org/dotnet
Nov 20 '05 #9

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

Similar topics

8
8258
by: Vanessa | last post by:
Hi In my VB Dot Net program, I'm using Automation to call Excel worksheet to do some insert some data. I have rename my worksheet to a name. eg. "ABC". How do I insert the worksheet name & Page No to the Footer so that when I print the worksheet, the name of the worksheet and page number will be printed out as well?
3
20283
by: Otie | last post by:
I found the following under the GetObject help notes and in the example for GetObject: "This example uses the GetObject function to get a reference to a specific Microsoft Excel worksheet (MyXL). It uses the worksheet's Application property to make Microsoft Excel visible, to close it, and so on. Using two API calls, the DetectExcel Sub procedure looks for Microsoft Excel, and if it is running, enters it in the Running Object Table. The...
1
6190
by: barma16 | last post by:
I've hit a bit of a brick wall here, and could use some advice. I have an Access application whose output is a four-tab Excel spreadsheet where three of the four tabs are the result of database queries. A number of fields in the queries are designed to become formulae in Excel after the export has taken place (and they need to be in Excel rather than Access). I need to use the TransferSpreadsheet Method rather than the OutputTo to enable...
2
5433
by: Praveen K | last post by:
I have a problem in communicating between the C# and the Excel Interop objects. The problem is something as described below. I use Microsoft Office-XP PIA dll’s as these dll’s were been recommended by many for web applications. I create the instances of Excel, Workbook and the worksheet. And later on Release the references by “System.Runtime.InteropServices.Marshal.ReleaseComObject(Object)” and making the object as null finally....
4
3123
by: goonsquad | last post by:
I'm writing an Excel Automation app and I'm running to a problem early on with what should be a basic step. Dim oExcel As Object Dim oBook As Object Dim oSheet As Object Dim oRng As Excel.Range oExcel = CreateObject("Excel.Application") oBook = oExcel.Workbooks.Add oSheet = oBook.Worksheets(1)
6
598
by: a.theil | last post by:
Please help! I need a simple excel automation, just 2 write some files into excel. I do: Dim oXL As Excel.Application Dim oWB As Excel.Workbook Dim oSheet As Excel.Worksheet Dim oRng As Excel.Range
7
2423
by: Alain \Mbuna\ | last post by:
Hi everybody. In my program I have some data that is calculated after some input from the user. I have written some code that opens an Excel workbook, with 5 worksheets and the calculated data (no database!)with some titles and info, is entered in the worksheet in a printable format. This is some of the code... Public exlAppl As Excel.Application
1
9775
by: smaczylo | last post by:
Hello, I've recently been asked to work with Microsoft Access, and while I feel quite comfortable with Excel, I'm at a complete loss with databases. If someone could help me with this issue I'm having I'd be most appreciative. The database is already constructed, I'm just wanting to export the data to an excel file. In short, I'm hoping to export two Tables (or queries...not sure which to use - they both seem to have the same data) in...
13
3008
by: chuckie_9497 | last post by:
hello all you gurus. I am struggling with releasing com objects. I have isolated the problem to the code below. Objects are released and the process ends until I use "int k = sheet.Count;" Then the process does not end. So I feel confident the problem occurrs here. It appears another reference is created that needs to be closed. Can anyone tell me how to do this? :) Thank you Excel.Workbook workbook =
7
18324
by: shantanu | last post by:
Hi all i am trying to save a excel file as a tab delimited text file. can i do it some how? i using the code _sheet1.SaveAs(@"C:\PRP \PRPTemp.txt",Excel.XlFileFormat.xlTextWindows ,Type.Missing,Type.Missing,Type.Missing,Type.Missing,Type.Missing,Type.Missing,Type.Missing); Kindly assist
0
8705
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8623
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
9054
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
8941
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
7785
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
6549
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5881
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
1
3071
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
2362
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.