View Single Post
 
Old 08-08-2014, 09:42 AM
whatsup whatsup is offline Windows 7 64bit Office 2010 32bit
Competent Performer
 
Join Date: May 2014
Posts: 137
whatsup will become famous soon enough
Default

Hi CatMan

Hm, quick and dirty you can obtain the value from the Listindex:
Code:
.
 .
 Dim strS11 As String, strS12 As String, strS13 As String
'strS11 = Uf_CertPlan_Owner.Lb_TeamPerformance.Value
'strS12 = Uf_CertPlan_Owner.Lb_ProgramPlan.Value
'strS13 = Uf_CertPlan_Owner.Lb_SowMaturity.Value
 With Uf_CertPlan_Owner
    With .Lb_TeamPerformance
        strS11 = .List(.ListIndex, 0)
    End With
    With .Lb_ProgramPlan
        strS12 = .List(.ListIndex, 0)
    End With
    With .Lb_SowMaturity
        strS13 = .List(.ListIndex, 0)
    End With
End With
 .
 .
Be aware:
It's not a proper solution, since it doesn't solve the problem at the root. It's just another way to obtain the desired data.

Where the problem comes from is difficult to say, you are using to many shortcuts in your script, e.g. there is no refering to a explicit property of a control, instead you merely refer to the default property which makes it difficult to read your code.
Your project seems too advanced to work it over completely so I won't say too much about it.
But one thing I recommend strongly to change:
Never use names for variables (neither for functions or subs) which are already in use by excel itself.
For instance: S11 refers to the cell "S11", is therefore in use of excel, and such things cause problems all the time.
If the particular problem is a result of this or something else I can't say, but it's the first thing you will have to change, otherwise you never will be sure if your scripts will work correctly.
Reply With Quote