R
Revolvr
I'm at a loss here...
I have code associated with controls on a worksheet, which call
subroutines in other modules, and I am passing an argument, a string,
indicating the success or failure of the operations in that
subroutine. Then the string gets appended to a TextBox. But I am not
able to pass the string argument.
In Sheet1 I have
Private Sub dothings_Click()
'Dim smsg As String
Call messagetest(smsg)
‘ Here if I check the value of smsg, it is empty.
NewMsg1 (smsg) ‘ writes to a text box
End Sub
The subroutine messagetest is in another module. Messagetest sets the
smsg string to a value, however when returning the value becomes an
empty string.
Sub messagetest(smsg As String)
smsg = "message test set this string"
End Sub
If this sub is in the same module as the sheet code, it works. I have
tried declaring smsg as public, but still doesn't work. I've tried
passign byval, still doesn't work.
Why is this and is it possible to pass arguments between code
associated with a worksheet, and modules?
Thanks!
I have code associated with controls on a worksheet, which call
subroutines in other modules, and I am passing an argument, a string,
indicating the success or failure of the operations in that
subroutine. Then the string gets appended to a TextBox. But I am not
able to pass the string argument.
In Sheet1 I have
Private Sub dothings_Click()
'Dim smsg As String
Call messagetest(smsg)
‘ Here if I check the value of smsg, it is empty.
NewMsg1 (smsg) ‘ writes to a text box
End Sub
The subroutine messagetest is in another module. Messagetest sets the
smsg string to a value, however when returning the value becomes an
empty string.
Sub messagetest(smsg As String)
smsg = "message test set this string"
End Sub
If this sub is in the same module as the sheet code, it works. I have
tried declaring smsg as public, but still doesn't work. I've tried
passign byval, still doesn't work.
Why is this and is it possible to pass arguments between code
associated with a worksheet, and modules?
Thanks!