I have dates in Excel that I need to pass to PowerPoint, but they keep getting formatted to my local formatting (portuguese). I need to force them to be in english format and have been searching but no solution worked for me.
I already tried SetThreadLocale, changing the formatting on excel and forcing it by code, but I was trying to avoid the last one.
Here's my code:
Sub ExportToPPT()
Dim ppt As Object
Dim pptpres As Object
Dim presentationDate As Date
presentationDate = #3/21/2024#
Set ppt = CreateObject("PowerPoint.Application")
Root = "C:\PPT_REPORTS\"
template = Root & "ppt_template.pptx"
Set pptpres = ppt.Presentations.Open(Filename := template)
pptpres.slides(1).Shapes.Item(2).TextFrame.TextRange.Text = Format(presentationDate, "mmmm dd")
End Sub
And here's the result:Image says "março 21"
I want to force it to be "March 21" without changing windows' regional formatting
Force US Month Name