Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
I've got the usual references to Excel and VBA in Tools-References,
but to play it safe I replaced my Left( ), Right( ), Mid( ), Chr( ), Val( ), and CVar( ) function calls by VBA.Left( ), ..., VBA.CVar( ) and all went well. However, when I replaced the Len( ) function call where it appeared in my code with VBA.Len( ) and then ran my program, execution stopped at the occurrance of one of those lines of code and displayed the following error message: "Compile error: Ony user-defined types in public object modules can be coerced to or from a variant or passed to late-bound functions" Can anyone tell me what this means in plain English? -- Dennis Eisen |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Dennis,
Sounds like if you're modifying Left, Right etc.. to VBA.Left then you may have some broken references. Check Tools | References for MISSING: But that's unrelated to your problem... I've had the error message before. I think it had something to do with a trying to convert a User Defined Type to a Variant. This example gives the same error, which can be fixed by declaring var as mytype: Type mytype teststring As String End Type Sub test() Dim var As Variant, udt As mytype var = udt End Sub Rob "DennisE" wrote in message ... I've got the usual references to Excel and VBA in Tools-References, but to play it safe I replaced my Left( ), Right( ), Mid( ), Chr( ), Val( ), and CVar( ) function calls by VBA.Left( ), ..., VBA.CVar( ) and all went well. However, when I replaced the Len( ) function call where it appeared in my code with VBA.Len( ) and then ran my program, execution stopped at the occurrance of one of those lines of code and displayed the following error message: "Compile error: Ony user-defined types in public object modules can be coerced to or from a variant or passed to late-bound functions" Can anyone tell me what this means in plain English? -- Dennis Eisen |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
x means Y | Excel Discussion (Misc queries) | |||
what it means in a range (B:B) | Excel Discussion (Misc queries) | |||
hi i would like to know what this means } | New Users to Excel | |||
replace ' and what it means | Excel Discussion (Misc queries) | |||
Can someone tell me what VBA means? (Macro and VBA) | Excel Discussion (Misc queries) |