Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Apologies
Please ignore this post
I must apologize because I've just realised this morning that a reference to a range was wrong in my code. This is so stupid of me not checking this before anything. So again please forgive me for posting this message And many thanks again to Tom. Regards Pascal "papou" a écrit dans le message de news: ... Hi all Following an answer from Tom Ogilvy (02/07/2003) regarding a counter on textboxes, I have come accross an error message that I don't quite understand. The error message is : "Execution error-2147024809 (80070057)" "Specified Object not found" The error arises at the userform_intialize event at line #5. I don't quite undestand why this error occurs now since I have tried the code several times and no error ever occured then. I have tried exporting and importing both Userform and class code to a new workbook in vain. Here's the code (sorry for this very long post): TIA Regards Pascal '========== in the classmodule: Public WithEvents TxtBox As MSForms.TextBox Private pRempli As String Property Let Rempli(Value As String) pRempli = Value End Property Property Get Rempli() As String Rempli = pRempli End Property Private Sub TxtBox_Change() If TxtBox.Value < "" Then If pRempli < "Rempli" Then AjoutMat.TxtNbPrixRest.Value = _ CLng(AjoutMat.TxtNbPrixRest.Value) - 1 pRempli = "Rempli" End If Else If pRempli = "Rempli" Then pRempli = "" AjoutMat.TxtNbPrixRest.Value = _ CLng(AjoutMat.TxtNbPrixRest.Value) + 1 End If End If End Sub '=============== in the userform module Private Sub UserForm_Initialize() Dim i As Integer ReDim TxtBoxClasses(1 To 20) For i = 1 To 20 Set TxtBoxClasses(i) = New TxtBoxClass Set TxtBoxClasses(i).TxtBox = AjoutMat.Controls(Sheets("AutresListes").Cells(i + 1, 19).Value) Next i AjoutMat.TxtNbPrixRest.Value = 20 'options prix non dispo tant que nouveau matériel non créé For Each Ctr In Me.Controls If TypeOf Ctr Is MSForms.OptionButton Then Ctr.Enabled = False Ctr.Value = False End If Next Ctr 'ajout liste nb catégories For y = 1 To 5 Me.CmbNbCat.AddItem y Next y 'désactivation de contrôles tant qu'un nouveau materiel n'est pas ajouté Me.ImgClear.Enabled = False Me.LabelCat.Enabled = False Me.CmbNbCat.Enabled = False Me.ChkCatZero.Enabled = False Me.TxtNbPrixRest.Visible = False Me.LblPrixRest.Visible = False 'Bouton validation non dispo Me.CmdValidNewMat.Enabled = False 'Définition liste des matériels existants Me.LstMatActuels.RowSource = "AutresListes!ListeMat" 'Largeur Usf Me.Width = 320 End Sub ' ---- In a declaration module: Public TxtBoxClasses() As New TxtBoxClass |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Apologies for multiple posts | Excel Worksheet Functions | |||
My Apologies For An Incorrect Date On My Computer | Excel Worksheet Functions | |||
Apologies , but I STILL need help with reversing content | Excel Worksheet Functions | |||
Apologies for triple post | New Users to Excel | |||
My Apologies | Excel Programming |