erro 424 ao abrir um form

Dúvidas gerais sobre Excel

erro 424 ao abrir um form

Mensagempor quenio » Sex Ago 10, 2012 3:42 pm

Boa tarde a todos do forum,

Pessoal após estar finalizando minha plan , obtive um erro , com 2 forms , quando tento executa-la tenho a mensagem de erro 424, objeto não encontrado ,


alguém tem alguma idea
quenio
 
Mensagens: 29
Registrado em: Qui Jul 05, 2012 10:13 pm
Agradecimentos dados: 0 vez
Agradecimentos recebidos: 2 vezes

Re: erro 424 ao abrir um form

Mensagempor webmaster » Sex Ago 10, 2012 5:17 pm

quenio,

Mais detalhes. Cadê o código? Em que linha dá erro? Etc, etc, etc...

Abraços
Tomás
http://www.tomasvasquez.com.br/blog
http://twitter.com/tomamais
Gostou da resposta? Clique no ícone Imagem da mensagem!
Se sua dúvida foi solucionada, acrescente [RESOLVIDO] ao título.
Avatar do usuário
webmaster
Administrador
 
Mensagens: 1722
Registrado em: Sex Jul 24, 2009 2:44 pm
Agradecimentos dados: 104 vezes
Agradecimentos recebidos: 77 vezes

Re: erro 424 ao abrir um form

Mensagempor quenio » Sex Ago 10, 2012 5:34 pm

na vdd não tenho uma linha especifíca.. segue o código... o erro é no form.
Código: Selecionar todos
Const nome = 1
Const senha = 2
Const nivel = 3
Const gestor = 5
Const gestorsenha = 6

Private Sub btAlterar_Click()
' Usuario
If OptUsuario.Value Then
    pergunta = MsgBox("Deseja alterar os dados?", vbExclamation + vbYesNo, "")
    If pergunta = vbNo Then
        Exit Sub
    End If
    lin = 3
    Do Until Sheets("Login").Cells(lin, nome) = ""
        If cdnome = Sheets("Login").Cells(lin, nome) Then
                    Sheets("Login").Cells(lin, nome) = cdnome
                    Sheets("Login").Cells(lin, senha) = cdSenha
                    Sheets("Login").Cells(lin, nivel) = cdNivel
        End If
        lin = lin + 1
    Loop
    '...................................................................
    'limpar
    lsLista.ListItems.Clear
    lastRow = Plan3.Cells(Plan3.Cells.Rows.Count, "a").End(xlUp).Row
    ' Adiciona itens
    For x = 3 To lastRow
        Set li = lsLista.ListItems.Add(Text:=Plan3.Cells(x, "a").Value)
            li.ListSubItems.Add Text:=Plan3.Cells(x, "b").Value
            li.ListSubItems.Add Text:=Plan3.Cells(x, "c").Value
    Next
        ActiveWorkbook.Save
End If
'Gestor
If OptGestor.Value Then
pergunta = MsgBox("Deseja alterar a senha do Gestor?", vbExclamation + vbYesNo, "")
    If pergunta = vbNo Then
        Exit Sub
    End If
    lin = 3
    Do Until Sheets("Login").Cells(lin, gestor) = ""
        If cdnome = Sheets("Login").Cells(lin, gestor) Then
                    Sheets("Login").Cells(lin, gestor) = cdnome
                    Sheets("Login").Cells(lin, gestorsenha) = cdSenha
        End If
        lin = lin + 1
    Loop
    '...................................................................
    'limpar
    lsListaGestor.ListItems.Clear
    lastRow = Plan3.Cells(Plan3.Cells.Rows.Count, "e").End(xlUp).Row
    ' Adiciona itens
    For x = 3 To lastRow
        Set li = lsListaGestor.ListItems.Add(Text:=Plan3.Cells(x, "e").Value)
            li.ListSubItems.Add Text:=Plan3.Cells(x, "f").Value
    Next
        ActiveWorkbook.Save
End If
End Sub

Private Sub btInserir_Click()
' Usuario
If OptUsuario.Value Then
    lin = 3
    Do Until Sheets("Login").Cells(lin, nome) = ""
        If cdnome = Sheets("Login").Cells(lin, nome) Then
            MsgBox "Nome já cadastrado! Por favor Verifique.", vbCritical, ""
            cdnome.SetFocus
            Exit Sub
        End If
        If cdnome = "" Or cdSenha = "" Or cdNivel = "" Then
            MsgBox "Campos obrigatórios não preenchidos! Por favor Verifique.", vbCritical, ""
            Exit Sub
        End If
        lin = lin + 1
    Loop
    Sheets("Login").Cells(lin, nome) = cdnome
    Sheets("Login").Cells(lin, senha) = cdSenha
    Sheets("Login").Cells(lin, nivel) = cdNivel
    '...................................................................
    'limpar
    lsLista.ListItems.Clear
    lastRow = Plan3.Cells(Plan3.Cells.Rows.Count, "a").End(xlUp).Row
    ' Adiciona itens
    For x = 3 To lastRow
        Set li = lsLista.ListItems.Add(Text:=Plan3.Cells(x, "a").Value)
            li.ListSubItems.Add Text:=Plan3.Cells(x, "b").Value
            li.ListSubItems.Add Text:=Plan3.Cells(x, "c").Value
    Next
    ActiveWorkbook.Save
    MsgBox "Usuário Cadastrado com Sucesso.", vbInformation, ""
    Call LimparCampos
    'Habilita
    OptGestor.Enabled = True
    OptGestor.Value = False
    OptUsuario.Enabled = True
    OptUsuario.Value = False
   
    End If
    'Gestor
    If OptGestor.Value Then
    lin = 3
    Do Until Sheets("Login").Cells(lin, gestor) = ""
        If cdnome = Sheets("Login").Cells(lin, gestor) Then
            MsgBox "Nome já cadastrado! Por favor Verifique.", vbCritical, ""
            cdnome.SetFocus
            Exit Sub
        End If
        If cdnome = "" Or cdSenha = "" Then
            MsgBox "Campos obrigatórios não preenchidos! Por favor Verifique.", vbCritical, ""
            Exit Sub
        End If
        lin = lin + 1
    Loop
    Sheets("Login").Cells(lin, gestor) = cdnome
    Sheets("Login").Cells(lin, gestorsenha) = cdSenha
    '...................................................................
    'limpar
    lsListaGestor.ListItems.Clear
    lastRow = Plan3.Cells(Plan3.Cells.Rows.Count, "E").End(xlUp).Row
    ' Adiciona itens
    For x = 3 To lastRow
        Set li = lsListaGestor.ListItems.Add(Text:=Plan3.Cells(x, "E").Value)
            li.ListSubItems.Add Text:=Plan3.Cells(x, "F").Value
    Next
    ActiveWorkbook.Save
    MsgBox "Gestor Cadastrado com Sucesso.", vbInformation, "Sistema Gestor - V 1.0"
    Call LimparCampos
    'Habilita
    OptGestor.Enabled = True
    OptGestor.Value = False
    OptUsuario.Enabled = True
    OptUsuario.Value = False
    End If
End Sub

Sub LimparCampos()
Me.cdSenha.Text = ""
Me.cdnome.Text = ""
Me.cdNivel.Text = ""
End Sub
Private Sub btLimpar_Click()
Call LimparCampos
End Sub

Private Sub btsair_Click()
frmUsuario.Hide
frmMenu.Show
End Sub

Private Sub cdNome_Change()
cdnome.Value = UCase(cdnome.Value)

cdSenha = ""
cdNivel = ""
lin = 3
Do Until Sheets("Login").Cells(lin, nome) = ""
    If cdnome = Sheets("Login").Cells(lin, nome) Then
    If cdSenha = Sheets("Login").Cells(lin, senha) Then
    End If
    End If
    lin = lin + 1
Loop
End Sub

Private Sub lsLista_Click()
    cdnome = lsLista.SelectedItem
    cdnome = lsListaGestor.SelectedItem
End Sub

Private Sub OptGestor_Click()
OptUsuario.Enabled = False
lsListaGestor.Visible = True
lsLista.Visible = False
Call HabilitaBotoes
Call HabilitaControleGestor

MsgBox "O Gestor tem Acesso Ilimitado ao Sistema!", vbInformation, ""
Call GestorlsLista
End Sub

Private Sub OptUsuario_Click()
OptGestor.Enabled = False
Call HabilitaBotoes
Call HabilitaControles

lsListaGestor.Visible = False
lsLista.Visible = True
Call UsuariolsLista
End Sub
Sub ComboBoxNivel()
cdNivel.AddItem "1"
cdNivel.AddItem "2"
cdNivel.AddItem "3"
cdNivel.AddItem "4"
End Sub

Private Sub UserForm_Initialize()
    lsListaGestor.Visible = False
    Call DesabilitaBotoes
    Call DesabilitaControles
    Call ComboBoxNivel
   
    With frmUsuario
    .Caption = "Cadastro de Usuários - [img][/img]"
End With
   HideCloseButton Me
End Sub

Sub GestorlsLista()
' Adiciona as colunas
    With lsListaGestor
        .Gridlines = True
        .View = lvwReport
        .FullRowSelect = True
        .ColumnHeaders.Add Text:="GESTOR", Width:=102
        .ColumnHeaders.Add Text:="SENHA", Width:=88
    End With
    '...................................................................
    'limpar
    lsListaGestor.ListItems.Clear
    lastRow = Plan3.Cells(Plan3.Cells.Rows.Count, "e").End(xlUp).Row
    ' Adiciona itens
    For x = 3 To lastRow
        Set li = lsListaGestor.ListItems.Add(Text:=Plan3.Cells(x, "e").Value)
            li.ListSubItems.Add Text:=Plan3.Cells(x, "f").Value
    Next
End Sub

Sub UsuariolsLista()
' Adiciona as colunas
    With lsLista
        .Gridlines = True
        .View = lvwReport
        .FullRowSelect = True
        .ColumnHeaders.Add Text:="USUÁRIO", Width:=102
        .ColumnHeaders.Add Text:="SENHA", Width:=88
        .ColumnHeaders.Add Text:="NIVEL", Width:=78
    End With
    '...................................................................
    'limpar
    lsLista.ListItems.Clear
       
    lastRow = Plan3.Cells(Plan3.Cells.Rows.Count, "a").End(xlUp).Row
    ' Adiciona itens
    For x = 3 To lastRow
        Set li = lsLista.ListItems.Add(Text:=Plan3.Cells(x, "a").Value)
            li.ListSubItems.Add Text:=Plan3.Cells(x, "b").Value
            li.ListSubItems.Add Text:=Plan3.Cells(x, "c").Value
    Next

End Sub
Private Sub HabilitaControles()
    Me.cdnome.Locked = False
    Me.cdSenha.Locked = False
    Me.cdNivel.Locked = False
   
    Me.cdnome.BackColor = &HC0FFC0
    Me.cdSenha.BackColor = &HC0FFC0
    Me.cdNivel.BackColor = &HC0FFC0
    End Sub

Private Sub DesabilitaControles()
    Me.cdnome.Locked = True
    Me.cdSenha.Locked = True
    Me.cdNivel.Locked = True
   
    Me.cdnome.BackColor = &HFFFFFF
    Me.cdSenha.BackColor = &HFFFFFF
    Me.cdNivel.BackColor = &HFFFFFF
End Sub
Private Sub HabilitaControleGestor()
    Me.cdnome.Locked = False
    Me.cdSenha.Locked = False
   
    Me.cdnome.BackColor = &HC0FFC0
    Me.cdSenha.BackColor = &HC0FFC0
    End Sub
Private Sub HabilitaBotoes()
    btInserir.Enabled = True
    btAlterar.Enabled = True
    btLimpar.Enabled = True
    End Sub

Private Sub DesabilitaBotoes()
    btInserir.Enabled = False
    btAlterar.Enabled = False
    btLimpar.Enabled = False
End Sub

Anexos
Sem título.png
Sem título.png (27.05 KiB) Exibido 159 vezes
quenio
 
Mensagens: 29
Registrado em: Qui Jul 05, 2012 10:13 pm
Agradecimentos dados: 0 vez
Agradecimentos recebidos: 2 vezes

Re: erro 424 ao abrir um form

Mensagempor quenio » Sáb Ago 11, 2012 9:23 am

supostamente os objetos não estão disponiveis no computador em que estou trabalhando.
Ex: em minha casa abre
no trabalho não


alguem tem alguma ideia
Anexos
Sem título.png
Sem título.png (84.78 KiB) Exibido 152 vezes
quenio
 
Mensagens: 29
Registrado em: Qui Jul 05, 2012 10:13 pm
Agradecimentos dados: 0 vez
Agradecimentos recebidos: 2 vezes

Re: erro 424 ao abrir um form

Mensagempor quenio » Seg Ago 13, 2012 11:49 am

ja resolví,

Solução, era preciso habilitar uma extensão para vb6 em preferências.ja que se você abrí-lo no excel 2010,desabilita ,após isso você deve habilitar também no 2007

att obrigado a todos
quenio
 
Mensagens: 29
Registrado em: Qui Jul 05, 2012 10:13 pm
Agradecimentos dados: 0 vez
Agradecimentos recebidos: 2 vezes

Anúncios


Voltar para Geral

Quem está online

Usuários navegando neste fórum: Nenhum usuário registrado e 1 visitante