View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Dave Peterson[_5_] Dave Peterson[_5_] is offline
external usenet poster
 
Posts: 1,758
Default Some worksheet returns NULL for CodeName property. Why?

Take a look at this bifurcated thread:
http://groups.google.com/groups?thre...GP10.phx .gbl
and
http://groups.google.com/groups?thre...0microsoft.com
(one line in your browser)

Shigeo Morita wrote:

To illustrate my problem, sample code given below:

set oEx = New Excel.Application
set oBk = oEx.Workbooks.Open("MyBook.xls")

dim oSh as Excel.Worksheet
For Each oSh In oBk.Worksheets
Debug.Print oSh.CodeName
Next

Sometimes I could not refer to the codename of worksheet. After I
intentionally create a tiny macro in the "MyBook.xls" and delete it, I could
refer to the codename of the sheets by the above code. I need to always
refer to the codename in my current project. Someone knows how?


--

Dave Peterson