Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]() I am trying to pass a custom class through a function, I can watch th variable, it gets passed to the function but when it goes to b returned I get this error, *Object doesn't support this property or method (Erro 438)* Am I doing the syntax wrong or something, here is the function. Function ChangeOffSet(SSheet As SSched) ' This Sets the Offset of the Variables If (SSheet.WorkMonth + SSheet.DaysOn) SSheet.DaysOff < 0 Then SSheet.WorkMonth = (SSheet.WorkMonth SSheet.DaysOn) Else SSheet.WorkMonth = SSheet.WorkMonth (SSheet.DaysOn) End If ChangeOffSet = SSheet End Function When I call it It looks like this I use the same variable names. *SSheet = ChangeOffSet(SSheet)* Thanks a bunc -- Xiaze ----------------------------------------------------------------------- Xiazer's Profile: http://www.excelforum.com/member.php...fo&userid=3158 View this thread: http://www.excelforum.com/showthread.php?threadid=54374 |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hi,
As it is an object you need to use the Set command. Set SSheet = ChangeOffSet(SSheet) and in the function set ChangeOffSet = SSheet Cheers Andy Xiazer wrote: I am trying to pass a custom class through a function, I can watch the variable, it gets passed to the function but when it goes to be returned I get this error, *Object doesn't support this property or method (Error 438)* Am I doing the syntax wrong or something, here is the function. Function ChangeOffSet(SSheet As SSched) ' This Sets the Offset of the Variables If (SSheet.WorkMonth + SSheet.DaysOn) - SSheet.DaysOff < 0 Then SSheet.WorkMonth = (SSheet.WorkMonth + SSheet.DaysOn) Else SSheet.WorkMonth = SSheet.WorkMonth + (SSheet.DaysOn) End If ChangeOffSet = SSheet End Function When I call it It looks like this I use the same variable names. *SSheet = ChangeOffSet(SSheet)* Thanks a bunch -- Andy Pope, Microsoft MVP - Excel http://www.andypope.info |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]() Thanks Andy, your my hero! -- Xiazer ------------------------------------------------------------------------ Xiazer's Profile: http://www.excelforum.com/member.php...o&userid=31581 View this thread: http://www.excelforum.com/showthread...hreadid=543749 |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Passing Variables through Custom Dialog Boxes | Excel Programming | |||
Passing multiple variables through functions | Excel Programming | |||
Passing variables from one sub to another | Excel Programming | |||
Passing Variables | Excel Programming | |||
passing variables | Excel Programming |