View Single Post
  #9   Report Post  
Posted to microsoft.public.excel.programming
Bob[_43_] Bob[_43_] is offline
external usenet poster
 
Posts: 5
Default The Tricky Blank CodeName Property & Excel 2002

Shah,

Thanks for the suggestion, but accessing any property of
Application.VBE results in the error "Programmatic access
to Visual Basic Project is not trusted" in Excel 2002. I
don't want to require users of my Add-In to lower their
security simply so that my Add-In works properly.

As a result, I've abandoned using CodeName and am using
worksheet.Name along with your method of detecting when a
worksheet has been renamed.

Bob

-----Original Message-----
Hi Bob,

With Dave Peterson's suggested method try this code.

Assign this macro to a custom button in your toolbar.

Close your VBE
Editor. Create a New workbook & click your custom

button. Works in
xl-2000.


Sub ShowCodeName()
Application.VBE.MainWindow.Visible = False
MsgBox ActiveSheet.CodeName
End Sub


Regards,
Shah Shailesh
http://members.lycos.co.uk/shahweb/