Q1: Change
oBook.SaveAs(filename) ####### Hardoced path works good.
Dim dlg As SaveFileDialog = New SaveFileDialog()
dlg.Filter = "Excel Files(*.xls)| *.xls"
If dlg.ShowDialog() = DialogResult.OK Then
Dim myname As String = dlg.FileName
Dim sw As New StreamWriter(myname)
'sw.Write(myname)
'using streamwriter to write text from richtextbox and saving it
End If
to
' oBook.SaveAs(filename) ####### Hardoced path works good.
Dim dlg As SaveFileDialog = New SaveFileDialog()
dlg.Filter = "Excel Files(*.xls)| *.xls"
If dlg.ShowDialog() = DialogResult.OK Then
' Dim myname As String = dlg.FileName
' Dim sw As New StreamWriter(myname)
'sw.Write(myname)
'using streamwriter to write text from richtextbox and saving it
oBook.SaveAs(dlg.FileName)
End If