Hello forum... its my first post here and Im hoping you can help me with a small problem Im trying to solve. Im very new to programming so please bear with me. Anyway, as you can see below, Im getting the error 'Object Refrence not set to an instance of an object? Please let me know if you need the remainder of the code.


Imports System.IO
Imports Excel
Imports System.Net.Mail

Module Module1

Private mo_Wsheet As New Worksheet

Sub Main()
.....
End Sub

Private Sub RunChart(ByVal pi_NewWSheet As Integer, ByVal ps_ChrtSizeX As Integer, ByVal ps_ChrtSizeY As Integer, ByVal ps_ChrtLocX As Integer, _
ByVal ps_ChrtLocY As Integer, ByVal StartRange As String, ByVal EndRange As String)

'Object Refrence not set to an instnace of an object?
Dim lo_charts As Excel.ChartObjects = DirectCast(mo_Wsheet.ChartObjects(), Excel.ChartObjects)
......

End Module