Champak Posted October 17, 2023 Posted October 17, 2023 My app exports an excel sheet with a column that has a date formatting. $oWorkbook2.Worksheets(1).Range("AO:AP").NumberFormat = "yyyy-mm-dd hh:mm:ss" This pretty much works as the output in the cells are "2023-10-16 03:36:08" as expected. But when I click on the cell and look in the formula bar, the date there shows as "10/16/2023 3:36:08 AM" which is a problem. The excel file is imported into a database and it seems as if that is seeing what is displayed in the formula bar and not in the actual cell. This issue is corrupting what I'm doing. How can I get the formatting to be exactly what I need it to be?
Champak Posted October 17, 2023 Author Posted October 17, 2023 Figured it out if anyone else runs into this issue. I took care of the formatting within the app and then formatted the column as text with: $oWorkbook2.Worksheets(1).Range("AO:AP").NumberFormat = "@"
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now