Bouzid Aissaoui

Bouzid Aissaoui

  • 2.2k
  • 4
  • 2.8k

How to Saveas xlsx file with file format as DBF4.

Nov 10 2015 12:08 PM

What can I do to be able to saveas DBF4 !  My goal is to convert from Excel to DBF

 Console.WriteLine(" XLS to MDB4 VS MDB4 to XLS");

Console.WriteLine("Where is the file you want to convert from ");
Console.ForegroundColor = ConsoleColor.White;
string FileName = Console.ReadLine(); Console.WriteLine();
; Console.WriteLine("Where do you want your Resulting file to be");
string OutPut_TargetFolder = Console.ReadLine();
if (FileName.Contains("xls") || FileName.Contains("XLS"))
Console.WriteLine("Working ...... Please wait");
excel.Application AppMX = new excel.Application();
var wb = AppMX.Workbooks.Open(FileName);
excel.Workbook ewb = AppMX.Workbooks.Open(FileName,null);
ewb.SaveAs(OutPut_TargetFolder, excel.XlFileFormat.xlDBF4 ); <==============Throws an Exception Exception from HRESULT: 0x800A03EC.
Console.WriteLine("Done Converting from XLSX TO CSV"); 

Answers (1)