Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Excel Object Model question (a How-To)

Status
Not open for further replies.

wolfess

Programmer
Oct 1, 2002
4
US
How do you change the tab name (I would think it would be called a caption or text) on the .activesheet object?

I've looked for an hour now up on MSDN and the only thing I have found is some articles referencing the tab object, but I'm not sure that is the object I want to use.

I have a master template spreadsheet that O must rename a tab on as the month changes.

TIA

v/r

Steve Wolfe
 
Activesheet.Name = "New name"

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ181-2886
 


FYI,

Often when coding, you want to be sure that the user does not screw up your application. -- make it bullet proof

So the USER can change the Sheet.Name.

Can't change the Sheet.CodeName -- that's TOTALLY controlled in VB Worksheet Properties.

Make the Sheet.Name what the user sees.

Use Sheet.CodeName to be absolutely certain what you are.

I like to use a convention for my sheet code names...
[tt]
wsSourceData
wsQryNames
[/tt]
Then you reference in your code...
Code:
    sSheetName = wsSourceData.Name


Skip,

[glasses] [red]A palindrome gone wrong?[/red]
A man, a plan, a ROOT canal...
PULLEMALL![tongue]
 
I want to thank all three of you for your help. And, not to be so much of a bug here on the forum, do any of you know of a good reference that lays out all of the excel object model objects with methods and properties easily identified?

I don't mind studying and it appears I'll be doing a lot of Excel automation here for the next couple of months.

My next task is to insert new reference worksheets into the user template as the RMO (Resource Mgt Office) folks chnage their minds every other day ...

Thanks again!

Steve
 
I've been really happy with my copy of Excel 2002 VBA Programmer's Reference from Wrox. The first 550 pages pertain to using VBA in Excel. After that there are close to 300 pages detailing the Excel 2002 Object Model, 25 pages explaining the VBE Object Model and lastly, around 80 pages about the Office XP Object Model.
 
I personally only play with the F2 and F1 keys when in VBE.

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ181-2886
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top