web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Automate / 'Save Excel' as csv is...
Power Automate
Unanswered

'Save Excel' as csv is changing date time regional format

(0) ShareShare
ReportReport
Posted on by 8

Hi

 

I have a simple flow that downloads an xlsx file from a website, opens the downloaded xlsx and saves it as a csv.

 

The problem is that the 'Save Excel' process is converting dates from the supplied dd/MM/yyyy hh:mm (26/06/2023 08:38) to m/dd/yyyy h:mm (6/26/2023 8:38). There are no further settings when saving an excel document:

 

ShackletonsDog_0-1687770992874.png

 

Here are the regional settings on my PC:

ShackletonsDog_1-1687771019603.png

 

All I am doing with excel in my flow is:

Launch Excel > Save Excel > Close Excel

 

How can I get this flow to save as csv with my regional settings, the same way this works if I manually save as csv in excel myself?

 

Any help is appreciated, thanks.

I have the same question (0)
  • ShackletonsDog Profile Picture
    8 on at

    Any suggestions at all would be very welcome, thanks 🙂

  • MichaelAnnis Profile Picture
    5,727 Moderator on at

    Try this.  It should open the workbook same as you opening it because Excel is opening it instead of PAD:

    Create a macro workbook (just have to save as .xlsm instead of .xlsx).  Write this macro (thx GPT for creating it.)  In the macro workbook, have A1 say: "FilePath:" and have B1 say: "FileName:".  Then create the following macro:

     

    Sub OpenFile()

     

    ' Declare variables
    Dim filePath As String
    Dim fileName As String

     

    ' Set variables
    filePath = ThisWorkbook.ActiveSheet.Range("A2").Value ' Get file path from A2
    fileName = ThisWorkbook.ActiveSheet.Range("B2").Value ' Get file name from B2

    ' Combine the file path and file name
    Dim fullPath As String
    fullPath = filePath & fileName

     

    ' Open the file
    Workbooks.Open (fullPath)

     

    End Sub

     

    The bot will open the macro workbook

    Have the bot write %Files[0].Directory% to A2

    Have the bot write %Files[0].Name% to B2

    Have the bot run the macro to open the file

     

    This should open the file the same as you open it.

    Have PAD attach to the newly opened file

    Have PAD Save and Close as .csv

     

    Best of luck!

  • ShackletonsDog Profile Picture
    8 on at

    Thank you Michael - I will give this a try and let you know how I get on.

     

    Thanks again 🙂

  • JamesRPA Profile Picture
    2 on at

    Hi,  Please follow step

    1. Lauanch Excel

    2. Get current date and time

    3. Convert datetime to text

    4. close excel 

    Please see picture

    savefile.jpg
  • Agnius Bartninkas Profile Picture
    Most Valuable Professional on at

    You can also do the following instead:

    1. Launch Excel

    2. Get first free column/row from Excel worksheet

    3. Read data from Excel

    4. Close Excel

    5. Loop through the table you got as a result of Reading from Excel

    6. Write to CSV

     

    This way you will control the creation of the CSV file and will not need to rely on the way Excel handles the conversion.

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Season of Sharing Community Challenge Launch!

Jump in, show your community spirit, and win prizes!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Congratulations to the May Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Automate

#1
Valantis Profile Picture

Valantis 474

#2
11manish Profile Picture

11manish 268

#3
David_MA Profile Picture

David_MA 243 Super User 2026 Season 1

Last 30 days Overall leaderboard