LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5
Default The Tricky Blank CodeName Property & Excel 2002

I've seen newsgroup messages back to 1999 trying to deal
with the problem where the CodeName property returns a
blank string unless the VBE gets "invoked" by one means
or another.

One of the simples solutions I've seen suggested fixing
this problem by simply making a reference to the
VBProject object as shown below:

Sub GetCodeName()
' Uncomment these two lines and .CodeName works
' because the VBProject object gets referenced.
'Dim s As String
's = ActiveWorkbook.VBProject.Name
MsgBox "CodeName = " & ActiveSheet.CodeName
End Sub

However, in Excel 2002 (and higher I assume) any
reference to the VBProject object results in the
error "Programmatic access to Visual Basic Project is not
trusted". You can make this error go away by enabling
Tools Macros Security Trusted Souces Trust access
to Visual Basic Project.

Here's the problem. I must use the CodeName property in
my Add-In that needs to work in Excel 2000 and higher. I
really do not want to have to require the user to
enable "Trust access to Visual Basic Project" in order
for my Add-In to work properly on Excel 2002 and higher.

Help! Does anyone have a solution for me?

 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Excel 2002: Can I not overwriting non blank destination cells ? Mr. Low[_3_] Excel Discussion (Misc queries) 0 March 13th 10 01:33 PM
Excel 2002: Return blank when VLOOKUP on blank cells Mr. Low Excel Discussion (Misc queries) 2 June 4th 09 05:12 PM
Excel 2002: How to add blank spaces to text and numbers Mr. Low Excel Discussion (Misc queries) 2 March 1st 08 02:34 PM
Excel 2002 : Problem in moving along blank cells Mr. Low Excel Discussion (Misc queries) 10 April 7th 07 04:16 PM
How can Excel 2002 start with blank workbook? Maureen Excel Discussion (Misc queries) 5 February 22nd 06 04:16 PM


All times are GMT +1. The time now is 10:34 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"