I am making a program to open an Excel file in C# and get the data from it.
private void XLConnect_Click(object sender, EventArgs e)
{
type = 1;
open.Filter = "Excel|.xlsx";
open.ShowDialog();
}
public void readFile()
{
if (type == 1)
{
MessageBox.Show("Success");
}
}
My problem with the code is that when the open dialog appears, it doesnt show any file to select. What is wrong in the code?