In my workspace we are very restricted in executing code, such as the VB solution in previous post. (Our IT guys are quite protective. A good thing of course, but sometimes a bit restrictive.)
An alternative solution is to set up your exceldocument manually in the correct format in advance.
The usual shortcut using UIPath is to export your data in excel scopes, which nicely creates the blank document for you. Cool feature, but unfortunaltely our friends at Microsoft decided that Excel should be in the drivers seat, and not you, and it starts applying its own interpretation of the data format.
By having a preformatted excel template stored somewhere accessible, writing your data is a small sequence of:
- copy your pre formatted excel to your document destination
- use the copied document in your excel scope
- write and save the data
If this also isn’t an option, because you need to append in other peoples documents, you can force excel to write any data as text by appending a
' to it (single quote).
write cell: 001 would become
write cell '001 instead. This does of course require extra some data manipulation on your side.
Hope this helps.