Can somebody help me regarding the problem I encountered in C# and Excel. Currently, my code goes like this:
string fname = Globals.ThisAddIn.Application.ActiveWorkbook.FullName;
con = new OleDbConnection(@"Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" + fname + ";Extended Properties=\"Excel 8.0;HDR=" + hdr + "\""
);
I am trying to connect to Excel worksheet as my database from my C# application. What bother's me is that, when the workbook or my database (fname) in the connection string above is currently open or when the con.Open() method is invoked, the application opens a readonly copy of the path, How could I prevent this?
Thank you!