LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 7
Default Class Module Question

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

 
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
CLASS MODULE & SIMPLE MODULE FARAZ QURESHI Excel Discussion (Misc queries) 1 September 7th 07 09:32 AM
Chart Class Module/follow on question to hyperlink post earlier. Rominall Charts and Charting in Excel 2 March 7th 07 02:43 AM
class module? sybmathics Excel Programming 17 February 25th 06 02:29 PM
Class module question David Excel Programming 4 September 8th 05 04:51 PM
Variable from a sheet module in a class module in XL XP hglamy[_2_] Excel Programming 2 October 14th 03 05:48 PM


All times are GMT +1. The time now is 12:43 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"