title: Guid in Excel Using SpreadSheetGear
body: <p>I just need a confirmation/quick info. I feel it's an obvious question but just want to make sure and fully understand what's happening. Couldn't find much detail on the web.</p>
  
  <p>I'm using SpreadSheetGear to dump data in spreadsheets from a datatable. There are some Guid in those tables. Now when I try to copy from my data table, I get an error saying wrong data type, unless I'm importing using the flags AllText or by removing the columns containing Guids in my datable.</p>
  
  <p>Seems like excel cannot support Guids as variable/data type. Is this normal? I don't necessarly need the data anyway can convert easily in text format, but I just want to fully understand this issue.</p>
  
  <p>Here's a sample code with the following error: Invalid cell value type.</p>
  
  
  
  <pre><code>public void Test()
  {
      DataTable table = new DataTable();
      table.Columns.Add("ID", typeof(Guid));
      table.Columns.Add("Drug", typeof(string));
      table.Columns.Add("Patient", typeof(string));
      table.Columns.Add("Date", typeof(DateTime));
  
      table.Rows.Add(Guid.NewGuid(), "Indocin", "David", DateTime.Now);
      table.Rows.Add(Guid.NewGuid(), "Enebrel", "Sam", DateTime.Now);
      table.Rows.Add(Guid.NewGuid(), "Hydralazine", "Christoff", DateTime.Now);
  
      IWorkbook wrk = Factory.GetWorkbook();
      IWorksheet wsht = wrk.Worksheets["Sheet1"];
      IRange rng = wsht.Cells["A1"];
      rng.CopyFromDataTable(table, SpreadsheetGear.Data.SetDataFlags.None);
      wrk.SaveAs("C:\\MyData.xls",FileFormat.OpenXMLWorkbook);
      wrk.Close();
  }
  </code></pre>