Return the Object that belongs to a CodePage
Thanks Thanks:  0
Likes Likes:  0
Results 1 to 4 of 4

Thread: Return the Object that belongs to a CodePage

  1. #1
    New Member
    Join Date
    Feb 2002
    Posts
    10
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default

     
    The opposite of this is easy to do, using
    Code:
    Object.CodePage
    however
    Code:
    CodePage.Parent
    only steps up the VBA object hierachy towards the VBE.

    The only way I can think of is by brute force...
    Code:
    For Each  In ThisWorkbook
      If .CodePage Is  Then
        Msgbox "This is the Object that belongs to the CodePage!"
      End If
    Next <>
    Any better ideas?

  2. #2
    Rest in Peace
    Join Date
    Feb 2002
    Posts
    1,582
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default

    Hi Bruce

    What is a "CodePage" ? Is this a variable you have assigned?


    >Object.CodePage

    What is the Object?




  3. #3
    MrExcel MVP Ivan F Moala's Avatar
    Join Date
    Feb 2002
    Location
    Auckland, New Zealand
    Posts
    4,209
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default

    Hi Bruce ....do you mean CodeName ??

    eg MsgBox Worksheets(1).CodeName


    Ivan

  4. #4
    New Member
    Join Date
    Feb 2002
    Posts
    10
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default

      
    Dave, Ivan

    Object has the usual VBA meaning. In this case it could be a workbook, sheet or activeX control,

    CodePage is is the VBA script associated with the object. All event triggered code is put here by default. eg Private Sub Workbook_WindowDeactivate(ByVal Wn As Excel.Window)

    and no, CodeName is the "code name" associated with an object, that can be refered to directly in VBA code, without using collection syntax
    eg
    Msgbox Worksheets("Data") 'using collection syntax
    Msgbox Sheet1 'using CodeName

    The helpfiles in Excel 2000 are a bit sketchy with regards to VBE objects, Excel97 even more so.

User Tag List

Like this thread? Share it with others

Like this thread? Share it with others

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  

 

 
DMCA.com