How do i create a Excel file?

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • dbncourt
    New Member
    • Mar 2012
    • 1

    How do i create a Excel file?

    Using c#, i want to create a Excel file in a given path and name. So far i found this, that could work but it doesnt!

    Code:
     oWB.SaveAs(filePath, ".xls", Missing.Value, Missing.Value , Missing.Value , Missing.Value, Excel.XlSaveAsAccessMode.xlShared, Missing.Value, Missing.Value, Missing.Value, Missing.Value, Missing.Value);
    and the same but insted of the filePath, the fileName. In both cases i get this error:

    Non controled exception 'System.Runtime .InteropService s.COMException' en Tesis.exe'. HRESULT Exception: 0x800A03EC

    Any ideas?¿

    I found another solution with a conection string and stuff, but i cant find my connection stirng anywhere on the internet :/
Working...