Hi - I have the following code to get a FileDialog box... the code is working in the development environment but when i build the solution and install it on another machine - it gives an error at the line
If .ShowDialog = DialogResult.OK Then
The error says 'Object reference not set to an instance of an object. Why is that - and how do i fix it ....
Friend WithEvents sfdRMSecurity As new System.Windows.Forms.SaveFileDialog
With sfdRMSecurity
.CheckPathExists = True
.Filter = "Excel files|*.xls"
.InitialDirectory = "c:" 'Environment.SpecialFolder.Personal
.OverwritePrompt = False
MsgBox("before Dialog shown")
If .ShowDialog = DialogResult.OK Then
MsgBox("after dialog shown")
saveName = .FileName
Else
Exit Sub
End If
End With