vilmarbr Posted July 17, 2007 Report Share Posted July 17, 2007 Compile error: Only user-defined types defined in public object modules can be coerced to or from a variant or passed to a late-boundfunctions.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 IntegerEnd TypePrivate g_arrGridCompra() As objTypeGridCompraPublic Sub x() If Not IsEmpty(g_arrGridCompra) Then MsgBox "Está vazio" Else MsgBox "NÃO está vazio" End IfEnd SubPorém eu já tentei declará-lo num módulo publico (.bas) num módulo objeto (.frm) e não deu certo ;(Como resolvo ? Quote Link to comment Share on other sites More sharing options...
0 Graymalkin Posted July 17, 2007 Report Share Posted July 17, 2007 Troque os "Private"s por "Public"s e veja se dá certo.Abraços,Graymalkin Quote Link to comment Share on other sites More sharing options...
0 vilmarbr Posted July 18, 2007 Author Report Share Posted July 18, 2007 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 redimensionadoIf Err.Number = 9 Then Exit For vlw ;) Quote Link to comment Share on other sites More sharing options...
Question
vilmarbr
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
functions.
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"
Else
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
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.