Pass Variable problems

Pass Variable problems

Anonymous
Not applicable
405 Views
2 Replies
Message 1 of 3

Pass Variable problems

Anonymous
Not applicable
I think this is a simple question but I cant seem to work it out. I have a main Sub that calls a Function, and I want to pass the value of a variable from my main Sub to my Function.

Here's what i'm doing, the whole code is rather long so here is a condensed version:
{code}
sub start()
'-open excel workbook-
dim oExclN as Integer
'-gather lots of information-
'-close workbook-
'-open inventor file-
call NewDocUpdater
end sub

private function NewDocUpdater()
'-call another function-
'-do stuff-
end function
{code}

I am trying to use "ByVal 'myvariable' as Integer". If I attach that to my Function, I get a "argument is not optional" error on the 'call NewDocUpdater' in my Sub. If i attach it to my Sub it wont run anymore. I've tried changing it to public and private on both Sub and Function but no change. And i'd like to pass this value along when my Function calls another routine.
0 Likes
406 Views
2 Replies
Replies (2)
Message 2 of 3

Anonymous
Not applicable
sub start()
'-open excel workbook-
dim oExclN as Integer
'-gather lots of information-
'-close workbook-
'-open inventor file-
call NewDocUpdater(Argument)
end sub

private function NewDocUpdater(Argument as ?)
'-call another function-
'-do stuff-
end function
0 Likes
Message 3 of 3

Anonymous
Not applicable
Thanks CadFish, that was my problem. I was missing that little tab on my 'Call' line.
0 Likes