Excel generates a .xlsx file for me through VBA from data in the existing workbook.
The generated file is uploaded to a web server and needs the date to be string in the format mm/dd/yyyy.
I though i was clever and to take into account users who have Regional setting in a different order I used the following:
textDate = Format(uploadDate, "mm/dd/yyyy")
ws1.Cells(i, 2).NumberFormat = "@"
ws1.Cells(i, 2).Value = textDate
But I not have a user that uses mm-dd-yyyy and the hyphens carry all the way through to the string. Which causes the upload file to error out.
I know i can use replace to remove hyphens for this but I want to be sure I can handle any odd setting for dates that a user may have.
Does anyone have any suggestions?
The generated file is uploaded to a web server and needs the date to be string in the format mm/dd/yyyy.
I though i was clever and to take into account users who have Regional setting in a different order I used the following:
textDate = Format(uploadDate, "mm/dd/yyyy")
ws1.Cells(i, 2).NumberFormat = "@"
ws1.Cells(i, 2).Value = textDate
But I not have a user that uses mm-dd-yyyy and the hyphens carry all the way through to the string. Which causes the upload file to error out.
I know i can use replace to remove hyphens for this but I want to be sure I can handle any odd setting for dates that a user may have.
Does anyone have any suggestions?