By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
429,045 Members | 1,305 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 429,045 IT Pros & Developers. It's quick & easy.

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

P: n/a
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
Share this Question
Share on Google+
8 Replies


P: n/a
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

P: n/a

"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

P: n/a
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

P: n/a
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

P: n/a
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

P: n/a
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

P: n/a
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

P: n/a
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 discussion thread is closed

Replies have been disabled for this discussion.