DataSet ds = new DataSet(); ds.DataSetName = "Configurations"; using ( OleDbConnection conn = new OleDbConnection("Provider=Microsoft.ACE.OLEDB.12.0;Data Source= " + xlsxPath + ";Extended Properties=\"Excel 12.0 Xml;HDR=YES\"")) { try { using (OleDbCommand command = new OleDbCommand("select * from [Sheet1$] ", conn)) { using (OleDbDataAdapter adapter = new OleDbDataAdapter(command)) { try { adapter.Fill(ds); } catch (Exception ex1) { MessageBox.Show(ex1.ToString()); } } } } catch (Exception ex) { MessageBox.Show(ex.ToString()); } } //this can be extended in to dofferent formats since we got the data in an object. ds.Tables[0].TableName = "Meters"; ds.WriteXml(xlsxPath.Substring(0, xlsxPath.IndexOf(".")) + ".xml")