Jump to content
Fórum Script Brasil
  • 0

Compile Error: Only User-defined Types Defined In Public Object Module



Compile error: Only user-defined types defined in public object modules can be coerced to or from a variant or passed to a late-bound


Este erro sempre está ocorrendo quando. tento verificar se o array abaixo está vazio:

Private Type objTypeGridCompra

strNome As String

strNomeExibido As String

blnVisivel As Boolean

intWidth As Integer

intPosicao As Integer

End Type

Private g_arrGridCompra() As objTypeGridCompra

Public Sub x()

If Not IsEmpty(g_arrGridCompra) Then

MsgBox "Está vazio"


MsgBox "NÃO está vazio"

End If

End Sub

Porém eu já tentei declará-lo num módulo publico (.bas) num módulo objeto (.frm) e não deu certo ;(

Como resolvo ?

Link to comment
Share on other sites

2 answers to this question

Recommended Posts

  • 0

so trocar os "Private"s por "Public"s não deu certo. acabei usando isto:

On Error Resume Next

'Verifica Visibildade e Largura das Colunas

.Columns(intLoop).Hidden = Not g_arrGridInformacoes(intLoop).blnVisivel

'O array ainda não foi redimensionado

If Err.Number = 9 Then Exit For

vlw ;)

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Answer this question...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


  • Forum Statistics

    • Total Topics
    • Total Posts
  • Create New...