Studio Excel format all

Hi,
I have Excel with 4 columns. Two of them are of Currency format and one is a number format and one is general.
I read the excel into a data table. Click the ‘Preserve Format’ checkbox. Now I do Write Range into another Excel. All the data is shown as "General’ in new Excel… it does not preserve format. What to do to keep the format as original ?
Thank you.

Hi @Prinal_C

If you select ‘Preserve Format’ Option even if you are unable to see the format in the other excel it still copies the data as it is in the same format
If you want to copy the entire excel then you can use ‘CopyFile’ option.

@vinithareddyk123 [quote=“vinithareddyk123, post:2, topic:330173”]
If you select ‘Preserve Format’ Option even if you are unable to see the format in the other excel it still copies the data as it is in the same format
[/quote]
Can you please explain this ?Are you saying that the format get’s copied as is in the new Excel even without ‘Preserve Format’ ? Unfortunately, it’s not happening that way. I need the datatable for various reasons so simple Copy File will not work for me.

Hi @Prinal_C

If you select ‘Preserve Format’ in the read range even though it is not visible the data is copied as it is in the format

Please find the below screenshots:

Please refer the above screenshots even though the column format is General but the data is in the currency format only.

Thanks

Hi Prinal,

If you want preserve excel format better keep a template excel with column names. You just copy that template and you can append the value from this sheet

May I know your full requirement?.So, I can try to sort it out your issue

@vinithareddyk123 Thanks. I have a column and the format is ‘Currency’ (e.g. $100.45). The data in the column is in currency format. I read it into a datatable and write it into a new sheet. I do not see the ‘$’ with the numbers. This is the issue.

Hi @Prinal_C

I have tried below way and it worked, Please try and let me know
PreserveExcelFOrmat.xaml (8.0 KB)

@vinithareddyk123 thanks. Can you please send the Excel ?

Hi @Prinal_C

Below is the code and excel I have Used.
PreserveExcelFOrmat.xaml (8.0 KB)
Book2.xlsx (8.6 KB)

Thanks

1 Like

Hi @Prinal_C

Did this work for you?

Thanks

1 Like

@vinithareddyk123 … yes, it did. Thank you.

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.