Tutorials & Examples Web-help Blog

Excel export date format


#1

Hi,
I have a problem.

I want to export an excel file with some column as date and I want that Excel can use the standard capabilities on this field (example: automatic aggregation by month using the filters).

Which function I need to use?

I tried to use:

  • date(): when I open the Excel it has the date columns in number format

  • format(date_as_number, ‘MM/dd/yyyy’): when I open Excel it has the date in text format

Thanks
Leonardo


#2

Hi Leonardo,

dates in EasyMorph are actually numbers, just like in Excel. Therefore, you can export number dates in EasyMorph into a spreadsheet and then simply apply necessary formatting in Excel. No special functions are necessary.

See this tutorial chapter with more explanation about dates in EasyMorph: https://easymorph.com/learn/expressions.html

**** moved to #uncategorized


#3

Thank you for the support.

But the problem is that I want to open Excel and to find the column directly in date visualization.

Following your solution :

I need to apply the formatting in the Excel before the automatic file sharing to the users.
I think the way is a macro in Excel called from Easy Morph.

Correct ?

thanks
Leonardo


#4

EasyMorph doesn’t format data when it exports it to Excel spreadsheet. Although, you can create a macro and run it using PowerShell from EasyMorph.

Here is an example of PowerShell script to run an Excel macro: https://stackoverflow.com/questions/19536241/calling-excel-macros-from-powershell-with-arguments

Check out also this topic: Importing password-protected xlsx

Note that this method only works in EasyMorph Desktop. It doesn’t work on EasyMorph Server.