On my last program the FSO doesn't work. it give me the "run-time error 91 object variable or with block variable not set", but if i run other program that have the same code "fso.createfolder" (fso as filesystemobject) it work's greats.. some one can help me to understand

FileObjectSystem Malfuction
Fire Fox gug
Mike11
Hello
You should post this to one of the VB news groups. The main goal of this forum is to answer questions around code performance & security using the advanced development tools in VSTS 2005 including static and dynamic analysis, code profiling, and unit testing.
Thanks
Brian [MSFT]
Microsoft Developer Support
This posting is provided "AS IS" with no warranties, and confers no rights.
Sinatra
(on spashscreen code)
Private Sub Form_Load()
lblVersion.Caption = "Version " & App.Major & "." & App.Minor & "." & App.Revision
lblProductName.Caption = "Relatorio de Avarias"
If fso.FolderExists(".\AvariaRelat") Then
fso.GetFolder (".\AvariaRelat")
Else
fso.CreateFolder (".\AvariaRelat")
End If
End Sub
#That code give me an error.. "run time 91 object variable or with block not set"......
But i have this code in another program
(on module code)
public fso as filesystemobject
(on splashscreen code)
Private Sub Form_Load()
lblVersion.Caption = "Version " & App.Major & "." & App.Minor & "." & App.Revision
Label1.Visible = False
Progress.Visible = False
If fso.FolderExists(".\data") Then
fso.GetFolder (".\data")
Else
fso.CreateFolder (".\data")
End If
If fso.FolderExists(".\data\users") Then
fso.GetFolder (".\data\users")
Else
fso.CreateFolder (".\data\users")
End If
If Not fso.FileExists(".\data\Materias.mdb") Then
a = MsgBox("A base de dados esta danificada ou inexistente", vbOKOnly + vbCritical, "Verificacao")
Else
Main
End If
End Sub
#and it works great.... someone help me to understand