View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
Dave Baranas[_2_] Dave Baranas[_2_] is offline
external usenet poster
 
Posts: 6
Default Listbox ColumnHeads

Hi All

I am working from the other side trying to get back to Excel where I
have lists for my Listboxes.

I have the code below working to do this

Sub PopulateLstBoxFromExcel()

Dim MfrRange As Range, MfrVal As Variant
Dim ObjXL As Object
Dim ObjActiveWkb As Object

Set ObjXL = GetObject(, "Excel.Application")
Set ObjActiveWkb = ObjXL.Application.ActiveWorkbook

With ObjActiveWkb

'Mfr Order
Set MfrRange = .Worksheets("List").Range("P2:P101")

MfrVal = MfrRange.Value
Mn.CboMfrOrd.List = MfrVal

End With

Set ObjActiveWkb = Nothing: Set ObjXL = Nothing

End Sub

I was not able to use the rowsource property like this below when I
was inside Excel

Mn.LstWlInd.RowSource = Mn.LstHsNm.RowSource = "List!Y2:Z102"

I am wondering if there is a way to use the Rowsource property on a
listbox when you are coming back into excel to get a list.

If not then I wonder if there is a way to get the variant to somehow
convert back to a string so I can feed it into the rowsource.

If not then I wonder if there is some black magic voodoo stuff to get
column heads turned on with having to use the rowsource property.

Any help in this direction would go a long way to conquer these evil
beasts for everyone:)

Regards,

Dave Baranas