A
Andrew Yates
Hi there,
I've received some software that I am trying to automate and by the
looks of it, I need to use Class Modules.
So after reading up about what Class modules are, I finally have come
to a point where I have a very slight understanding what is happening.
Anyway, I've got to a point where the code looks like it is almost
working (I think). Could somebody please have a look at the below code
and let me know what the logic flaw is.
===============
Module code
===============
Public Class1 As New classmodule1
sub TransferFile()
With Class1
.send
End With
End Sub
===============================================
Class Module code - the class is called classmodule1
===============================================
Dim WithEvents mSession As BS.Session
Dim mCancelCommand As Boolean
Dim mFileName As String
Public Sub send()
mCancelCommand = False
mFileName = "file1234"
mSession.SENDFROMFILE mFileName ' this is where it is crashing
End Sub
I am receiving the following error:
"Object variable or With block variable not set" and it is crashing at
the " mSession.SENDFROMFILE mFileName" line. The value of mSession =
nothing which I assume is the problem but as would be quite apparent to
anybody reading this far, I don't have a clue.
Any assistance is much appreciated.
Regards,
Andrew
I've received some software that I am trying to automate and by the
looks of it, I need to use Class Modules.
So after reading up about what Class modules are, I finally have come
to a point where I have a very slight understanding what is happening.
Anyway, I've got to a point where the code looks like it is almost
working (I think). Could somebody please have a look at the below code
and let me know what the logic flaw is.
===============
Module code
===============
Public Class1 As New classmodule1
sub TransferFile()
With Class1
.send
End With
End Sub
===============================================
Class Module code - the class is called classmodule1
===============================================
Dim WithEvents mSession As BS.Session
Dim mCancelCommand As Boolean
Dim mFileName As String
Public Sub send()
mCancelCommand = False
mFileName = "file1234"
mSession.SENDFROMFILE mFileName ' this is where it is crashing
End Sub
I am receiving the following error:
"Object variable or With block variable not set" and it is crashing at
the " mSession.SENDFROMFILE mFileName" line. The value of mSession =
nothing which I assume is the problem but as would be quite apparent to
anybody reading this far, I don't have a clue.
Any assistance is much appreciated.
Regards,
Andrew