Worksheet.GetCodeName/Get_CodeName

  • Thread starter Thread starter Gap
  • Start date Start date
G

Gap

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.
 
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
 
Bernie Deitrick said:
Gap,

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

Works quite nicely without the reference Bernie.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top