Highlighted
New Member.
1901 views

Date in Excel

Jump to solution

i am sending a variable with the value 10/05/2013 to an excel cell but it transforms it to 05/10/2013. why?

0 Likes
1 Solution

Accepted Solutions
Highlighted
New Member.

RE: Date in Excel

Jump to solution

OK i found that if i do that command the date remains i want.

MODIFY olWrkSh Range(TARGET)::NumberFormat = "@".

Thanks a lot!!!

View solution in original post

0 Likes
6 Replies
Highlighted
Absent Member.
Absent Member.

RE: Date in Excel

Jump to solution

I am pretty sure that is because of your regional settings, go to Windows control panel, 'clock, language and region' (in Win 7, may be different in other versions) then set you default date format. It works for me 🙂

0 Likes
Highlighted
New Member.

RE: Date in Excel

Jump to solution

no that is not working. the first half of the excel i create has the wrong date (mm/dd/yyyy) and the second half the correct (dd/mm/yyyy)

0 Likes
Highlighted
Honored Contributor.
Honored Contributor.

RE: Date in Excel

Jump to solution

what happens when you format the line/row with the correct style before you fill the value?

0 Likes
Highlighted
New Member.

RE: Date in Excel

Jump to solution

ok how can i format it? what i have to do can you explain step by step the commands?

0 Likes
Highlighted
New Member.

RE: Date in Excel

Jump to solution

thas my code

          MOVE  ET-HMERA            TO W-BX-EXCEL-HMERA        

          MOVE  ET-MHNAS            TO W-BX-EXCEL-MHNAS        

          MOVE  ET-ETOS             TO W-BX-EXCEL-ETOS

          MOVE W-BX-EXCEL-DATE TO W-BX-EXCEL-TEMP

          MODIFY olWrkSh Range(TARGET)::Value = W-BX-EXCEL-TEMP          

     *     MODIFY olWrkSh Range(TARGET)::NumberFormat = "dd/mm/yyyy"

          PERFORM INCREASE-COLUMN-COUNTERS

0 Likes
Highlighted
New Member.

RE: Date in Excel

Jump to solution

OK i found that if i do that command the date remains i want.

MODIFY olWrkSh Range(TARGET)::NumberFormat = "@".

Thanks a lot!!!

View solution in original post

0 Likes
The opinions expressed above are the personal opinions of the authors, not of Micro Focus. By using this site, you accept the Terms of Use and Rules of Participation. Certain versions of content ("Material") accessible here may contain branding from Hewlett-Packard Company (now HP Inc.) and Hewlett Packard Enterprise Company. As of September 1, 2017, the Material is now offered by Micro Focus, a separately owned and operated company. Any reference to the HP and Hewlett Packard Enterprise/HPE marks is historical in nature, and the HP and Hewlett Packard Enterprise/HPE marks are the property of their respective owners.