Hi,
Im trying to export data from my grid to the excel using UltraGridExcelExporter.
below is my code and the datagrid has data in it, but at the line "Me.UltraGridExcelExporter1.Export(Me.grdViewEdit, myStream)", Im getting the "Object reference not set to an instance of an object." error.
Can anyone please help?
Code:
Private Sub UltraButton1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnExport.Click Dim myStream As String Dim saveFileDialog1 As New SaveFileDialog() saveFileDialog1.Filter = "Excel Files (*.xls)|*.xls" saveFileDialog1.FilterIndex = 2 saveFileDialog1.RestoreDirectory = True If saveFileDialog1.ShowDialog() = DialogResult.OK Then myStream = saveFileDialog1.FileName() Me.UltraGridExcelExporter1.Export(Me.grdViewEdit, myStream) End If End Sub