Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 66
Default Can someone tell me what this means?

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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,236
Default Can someone tell me what this means?

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
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
x means Y MitzDriver Excel Discussion (Misc queries) 3 October 8th 09 12:32 PM
what it means in a range (B:B) starguy Excel Discussion (Misc queries) 2 April 12th 06 01:00 PM
hi i would like to know what this means } [email protected] New Users to Excel 1 February 24th 06 09:30 PM
replace ' and what it means jonasa Excel Discussion (Misc queries) 6 February 20th 06 12:30 PM
Can someone tell me what VBA means? (Macro and VBA) AncoatsRed Excel Discussion (Misc queries) 1 January 30th 06 08:36 PM


All times are GMT +1. The time now is 03:33 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"