Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 19
Default HELP "ByRef Argument Type Mismatch"

OK, I accept that it isn' t possible. I 'broke up' the type into its
components to pass it.

NickHK wrote:
I get a compile error on such a set up, as you cannot use user defined types
as arguments or return values in public routine.

Your type is private, so the Update routine cannot see it.
Maybe move to using a Class instead.

NickHK

"RocketMan" wrote in message
oups.com...
I get the compile error: ByRef Argument Type Mismatch
at the line Call Upate(itercount, a(i))

and it doesn't make sense to me. I am passing only one element of an
array and the types seems fine to me.

HELP

Here is the example:

Private type Iteration
Name as string
count as integer
end type

private type j
domain as string
it() as Iteration
end type

public function start()
dim i, itercount as integer
dim a(500) as j
itercount = Worksheet("iters").Range("c1")
for i = 0 to 499
redim a(i).it(itercount ) as Iteration
Call Update(itercount, a(i))
next

end function

' NOTE this function is in a separate ( .xla sheet) Module

Public Function Update(byval icount as long, byref DomIters as j)
' stuff done in here
end function


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
"Type mismatch" when I try to fill an Array variable with "+" [email protected] Excel Discussion (Misc queries) 1 April 17th 07 01:28 PM
Error Handling to mitigate "Run Time Erorr 13 Type Mismatch" ExcelMonkey Excel Programming 3 October 16th 05 01:56 PM
"ByRef argument type mismatch" Error Baapi[_4_] Excel Programming 2 September 17th 05 12:47 AM
ByRef argument type mismatch error? sermest Excel Programming 4 June 17th 05 06:50 PM
"FIND" generates "Type mismatch" error quartz[_2_] Excel Programming 5 November 16th 04 03:29 PM


All times are GMT +1. The time now is 06:49 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"