1
Reply

How to Saveas xlsx file with file format as DBF4.

Bouzid Aissaoui

Bouzid Aissaoui

Nov 10 2015 12:08 PM
825

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()
; 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.
wb.Close();
AppMX.Quit();
Console.WriteLine("Done Converting from XLSX TO CSV"); 
 

Upload Source Code  Select only zip and rar file.
Answers (1)