List view column headers not appearing - despite view = lvwReport
Results 1 to 2 of 2

Thread: List view column headers not appearing - despite view = lvwReport
Thanks Thanks: 0 Likes Likes: 0

  1. #1
    Board Regular
    Join Date
    Jan 2007
    Posts
    53
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default List view column headers not appearing - despite view = lvwReport

    Dear All,

    I created a listview (Search_Master) in one project. I copied it to another project. However, in that project, it is not showing the listview column headers. It is surprising because it's working fine in the earlier project. The only major difference between the two is that in the 1st project, the column headers are obtained from a sheet in the same workbook while in the 2nd project they are obtained from another workbook. Is there any restriction on using column headers from another workbook?

    I am attaching the code herewith for your reference.

    Any inputs will be highly appreciated!

    Thanks in Advance!


    Code:
    Private Sub Master_Cat_Change()
    
    Application.ScreenUpdating = False
    
    'to show all sheet
    Application.Run "show_all"
    
    If Master_Cat.Value = "Child Master" Then catcol = 10
    If Master_Cat.Value = "Survey Master" Then catcol = 13
    If Master_Cat.Value = "Anganwadi Master" Then catcol = 8
    If Master_Cat.Value = "Beat Master" Then catcol = 9
    If Master_Cat.Value = "ICDS Project Master" Then catcol = 12
    If Master_Cat.Value = "Taluka Master" Then catcol = 14
    If Master_Cat.Value = "District Master" Then catcol = 11
    If Master_Cat.Value = "Project Master" Then catcol = 15
    
    WS = Worksheets("Login").Cells(1, 1001)
    main_path = "D:\Teaching\Excel\Clients\Annada\System\Database Files"
    proj = Worksheets(WS).Cells(1, 12)
    finpath = main_path & "\" & proj & "\"
    fnam = finpath & Master_Cat.Value & ".xlsx"
    
    Workbooks.Open Filename:=fnam, Password:="abcd", WriteResPassword:="1234"
    
    dbook = ActiveWorkbook.Name
    Worksheets(Master_Cat.Value).Select
    
      Dim C As Long
      Dim I As Long
      Dim R As Long
        
        ThisWorkbook.Activate
        Me.Search_Result.View = lvwReport
        Me.Search_Result.HideSelection = False
        Me.Search_Result.FullRowSelect = True
        Me.Search_Result.HotTracking = True
        Me.Search_Result.HoverSelection = False
      
        Me.Search_Result.ColumnHeaders.Clear
        Me.Search_Result.ColumnHeaders.Add Text:="", Width:=2
    
          
          For C = 1 To 16384
        If Workbooks(dbook).Worksheets(Master_Cat.Value).Cells(1, C) = "" Then GoTo outsideC:
        
        hedding = Workbooks(dbook).Worksheets(Master_Cat.Value).Cells(1, C).Text
        
        Me.Search_Result.ColumnHeaders.Add , , hedding, 75
        Next C
    outsideC:
        
        Workbooks(dbook).Close (False)
        Workbooks.Open Filename:="D:\Teaching\Excel\Clients\Annada\System\Database Files\Supporting Masters.xlsx", Password:="abcd", WriteResPassword:="1234"
        dbook = ActiveWorkbook.Name
    
        Worksheets("Supporting Masters").Select
        Me.Cat.Clear
        
        For I = 2 To 1048576
        
        If Cells(I, catcol) = "" Then Exit For
        Me.Cat.AddItem Cells(I, catcol).Text        'material code
        Next I
        
    'to hide all sheet
    Workbooks(dbook).Close (False)
    ThisWorkbook.Activate
    Application.Run "hide_all"
    Application.ScreenUpdating = True
    
    
    End Sub

  2. #2
    Board Regular
    Join Date
    Jan 2007
    Posts
    53
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default Re: List view column headers not appearing - despite view = lvwReport

    I got the solution. I simply removed the list view lying on my user form and re-inserted a new one. Gave it the same name, Search_Result and voila! It started working! How silly! Anyways, thank you very much to all of you who spent some time wondering what may have gone when everything appeared in order..

Some videos you may like

User Tag List

Tags for this Thread

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
  •