Home |
Search |
Today's Posts |
|
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
I changed it as suggested. It gives the error:
Only user-defined types defined in public object modules can be coerced to or from a variant or passed to late-bound functions. "Tushar Mehta" wrote: What version of XL / VBA are you using? Does the compiler highlight a particular line as the offending line? At the very least you should change the return type of the function from readers() to reader() -- Regards, Tushar Mehta www.tushar-mehta.com Excel, PowerPoint, and VBA add-ins, tutorials Custom MS Office productivity solutions In article , says... I have defined the following: Type reader r_sname As String r_name As String r_restel As String r_offtel As String r_mobile As String End Type and am trying to use it in the following function: Function GetReaderRecordsArray(rngTimeCell As Range) As readers() Dim rngCommRng As Range Dim u_readers() As reader Dim bCommArr() As Boolean Dim i As Integer Dim j As Integer Dim c_comm As Integer Set rngCommRng = GetCommitRng(rngTimeCell) bCommArr = GetCommFromCommitRng(rngCommRng) c_comm = GetYesCountFromCommRng(bCommArr) If c_comm 0 Then ReDim u_readers(c_comm) i = 0 For j = LBound(bCommArr) To UBound(bCommArr) If bCommArr(j) Then i = i + 1 u_readers(i) = GetReaderRecord(rngCommRng.Cells(j, 1)) Else End If Next j End If GetReaderRecordsArray = u_readers End Function I get a compile error msg. Can anyone help me fix this? |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
You still haven't answered the first question.
Also, where -- what kind of module(s), that is -- do you have all this code? And, did you write the code or did you get it from somewhere else? -- Regards, Tushar Mehta www.tushar-mehta.com Excel, PowerPoint, and VBA add-ins, tutorials Custom MS Office productivity solutions In article , says... I changed it as suggested. It gives the error: Only user-defined types defined in public object modules can be coerced to or from a variant or passed to late-bound functions. "Tushar Mehta" wrote: What version of XL / VBA are you using? Does the compiler highlight a particular line as the offending line? At the very least you should change the return type of the function from readers() to reader() -- Regards, Tushar Mehta www.tushar-mehta.com Excel, PowerPoint, and VBA add-ins, tutorials Custom MS Office productivity solutions In article , says... I have defined the following: Type reader r_sname As String r_name As String r_restel As String r_offtel As String r_mobile As String End Type and am trying to use it in the following function: Function GetReaderRecordsArray(rngTimeCell As Range) As readers() Dim rngCommRng As Range Dim u_readers() As reader Dim bCommArr() As Boolean Dim i As Integer Dim j As Integer Dim c_comm As Integer Set rngCommRng = GetCommitRng(rngTimeCell) bCommArr = GetCommFromCommitRng(rngCommRng) c_comm = GetYesCountFromCommRng(bCommArr) If c_comm 0 Then ReDim u_readers(c_comm) i = 0 For j = LBound(bCommArr) To UBound(bCommArr) If bCommArr(j) Then i = i + 1 u_readers(i) = GetReaderRecord(rngCommRng.Cells(j, 1)) Else End If Next j End If GetReaderRecordsArray = u_readers End Function I get a compile error msg. Can anyone help me fix this? |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Complex conditional summing - array COUNT works, array SUM gives#VALUE | Excel Worksheet Functions | |||
Prevent cell/array references from changing when altering/moving thecell/array | Excel Discussion (Misc queries) | |||
meaning of : IF(Switch; Average(array A, array B); array A) | Excel Worksheet Functions | |||
Array problem: Key words-Variant Array, single-element, type mismatch error | Excel Programming | |||
Array problem: Key words-Variant Array, single-element, type mismatch error | Excel Programming |