0

I'm using Janus gridex and Janus gridex exporter. I have one problem when I wanna export it to excel. actually below is my code

Dim filep = ""
    Dim saveDialog As New SaveFileDialog
    saveDialog.DefaultExt = "xls"
    saveDialog.Filter = "Excel File (*.xlsx)|*.*"
    If saveDialog.ShowDialog() = DialogResult.OK Then
        Using st As New IO.FileStream(saveDialog.FileName, FileMode.Create, FileAccess.Write, FileShare.None)
            GridEXExporter1.Export(st)

            filep = saveDialog.FileName
        End Using
    End If

during export it working fine but it allow only extension .xls for .xlsx it not allow and it always pop up asking message before user open that file. anyone has some solution please kindly help. Thanks.

Uy Suy
  • 11
  • 6

2 Answers2

0

This is more of a cheap hack than a fix, but you could use:

System.IO.File.Move("oldfilename", "newfilename");

to rename the extension to .xlsx

Prashant Pimpale
  • 10,349
  • 9
  • 44
  • 84
0

rename extension to .xml, and open that file from excel.

eaydemir
  • 47
  • 8
  • Please explain why this is a solution. What does your solution do, how does it solve the problem.(It should also have an educational effect on people who find this question because they have a similar problem. ) –  Feb 25 '21 at 15:10
  • Because output file format is xml, excel has different behavior for different file type. – eaydemir Jun 08 '21 at 11:45