For some reason my program gives me an error, telling me "Use of unassigned local variable 'path'", it's really god damn annoying, tried restarting visual studio ( 2017 community ) several times and to no avail, tried to rebuild Solution... nothing is working for some reason..
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
namespace InterfacedStorage
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}
private void Form1_Load(object sender, EventArgs e)
{
OpenFile();
}
public void OpenFile()
{
OpenFileDialog openFile = new OpenFileDialog();
string path; // Declared path
if (openFile.ShowDialog() == System.Windows.Forms.DialogResult.OK)
{
path = openFile.FileName; // Input path from a file
}
Excel excel = new Excel(path, 1); // Path is not declared...
MessageBox.Show(excel.ReadCell(0, 0));
}
}
}