View Single Post
  #6   Report Post  
Posted to microsoft.public.excel.programming
Dianne Dianne is offline
external usenet poster
 
Posts: 107
Default From my Addin, referring to activeworkbook's sheets by their codenames

Rob,

Thanks for that -- I like it! Before I rewrite all my code, however, a
couple quick questions --

This workbook will be used throughout our company on remote worksites --
probably by about 25 - 40 people. By using the worksheets' codenames, I was
trying to eliminate the possibility of problems that would arise if one of
the users renamed a sheet. However...

Is there a lot of overhead involved in calling this function each time I
need to refer to a sheet (although my code doesn't do a lot of it)? Or would
I be better off telling everyone not to rename the sheets and then in my
code I could just use ActiveWorkbook.Worksheets("SheetName")?

I've never used the VBProject object or VBComponents collection before. Is
this likely to cause any problems when distributed? By that I mean, if a
user doesn't have a full installation of Excel 97, would this code still
work?

Thanks.
Dianne


"Rob Bovey" wrote in message
...

Function szSheetTabName(ByRef wkbProject As Workbook, _
ByRef szCodeName As String) As String
szSheetTabName = wkbProject.VBProject _
.VBComponents(szCodeName).Properties("Name")
End Function