Re: Error in Call statement

Tech Tip: Click here to run a free scan for Windows Errors and optimize PC performance



Marv wrote:

Public Sub AdjustPrtLine(ModelRec)
' do something
End Sub

However, when I try to run it I get the message:
" Only user defined types defined in public pbject modules can be
coerced to or from a variant or passed to a late bound function."


Try declaring a type for ModelRec, instead of leaving it a variant:

Public Sub AdjustPrtLine(ModelRec As RecordC)


.



Relevant Pages

  • RE: VBA block cell copying.
    ... Dim SavedCells() As Variant ... Public Function SaveSquareAs Variant ... ' Save contents from 9 cell square given top left cell ... Public Sub LoadSquare ...
    (microsoft.public.excel.programming)
  • Re: Disconnected Range to Variant
    ... Public Sub DisconectedRange() ... Dim vArray As Variant ...
    (microsoft.public.excel.programming)
  • Re: Can a function return more than one value ?
    ... You can return an array, a collection, or a delimited string. ... Public Function TestFunc() As Variant ... Public Sub CallTestFunc() ...
    (microsoft.public.access.gettingstarted)
  • Re: ParamArray and Interfaces
    ... Public Sub WriteLine(text As String, ParamArray arguments() As Variant) ...
    (microsoft.public.vb.general.discussion)
  • Re: type mismatch?
    ... i guess my question now is why it wouldn't work with Label? ... > public sub myFunc(a as variant, b as variant, optional c as variant, optional ... >> public sub myFunc(a as string, b as string, _ ...
    (microsoft.public.excel.programming)