Skip to main content

Can a print file be saved as a xlsx (Excel) file somehow via a cobol program? On Version 10.5.0.

Can a print file be saved as a xlsx (Excel) file somehow via a cobol program? On Version 10.5.0.

Good morning, Doc .

ACUCOBOL-GT does not include a native way to save a file as an Excel file.

You can define the file as a LINE SEQUENTIAL file,
give it a name with a ".csv" file extension, 
and organise the fields so that they respect the CSV syntax.
Once done, you'll be able to open/import this file from your Excel.

Alternatively, you can call the Excel methods and classes directly from within the ACU program,
to create a proper Excel file.

Samples of codes are available in this Community.
For example: https://community.rocketsoftware.com/discussion/saving-excel-workbook-to-specified-file#bm300dea6e-b99e-46da-8029-2520418e3f82

Regards.


Can a print file be saved as a xlsx (Excel) file somehow via a cobol program? On Version 10.5.0.

I did not succeed with Claudio's suggested example.
However, I can tell you that I use a callable program that create an XML file, which is compatible with all the spreadsheets (Excel and freeware) that I have tested.
Set the windows default program for XML to Excel and off you go.
Obviously the file size is MUCH bigger, but all you have to do is drop the exported filename on the command line and it just works.



------------------------------
Peter Clayton
Developer
Cobsolv Cc
Midrand ZA
------------------------------