View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Bernie Deitrick Bernie Deitrick is offline
external usenet poster
 
Posts: 5,441
Default Worksheet.GetCodeName/Get_CodeName

Gap,

Try something along these lines, with a reference set to MS VBA
Extensibility:

Sub ShowCodeName()
MsgBox ActiveWorkbook.VBProject.VBComponents(ActiveSheet. Name) _
.Properties("_CodeName").Value
End Sub

HTH,
Bernie
MS Excel MVP

"Gap" wrote in message
oups.com...
Hello

Both these methoeds return empty strings to my C++ Add-in code.
Whereas VBA returns the expected codes sheet1, sheet2 etc..

Any idea how to get these Worksheet codes with automation?

Regds
Gap.