473,322 Members | 1,241 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,322 software developers and data experts.

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
Jul 19 '05 #1
8 8222
Hello,

"Vanessa" <va*****@eclinic.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

Jul 19 '05 #2

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

"Vanessa" <va*****@eclinic.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

Jul 19 '05 #3
Hello,

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

???

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

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

With ActiveSheet.PageSetup
.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*****@eclinic.com.sg> wrote in message
news:ek**************@TK2MSFTNGP09.phx.gbl...

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

"Vanessa" <va*****@eclinic.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


Jul 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
Jul 19 '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
Jul 19 '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.

:-)
Jul 19 '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
Jul 19 '05 #9

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

Similar topics

3
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...
1
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...
2
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...
8
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 &...
4
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...
7
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...
1
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...
13
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...
7
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...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...

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.