Excel leading zeros

Hello community,
I am feeding an excel file with strings.
When I have leading zeros excel remove them.
We can add this leading zeros back into excel but we would like to avoid this operation.
We have found that if the data is read from a Revit schedule instead the leading zeros are kept in excel.
The cell format is text in excel in both datasets so the format is not the issue.
Have you experienced the same???
Any ideas how to solve this???

Append a single quotation mark before your values.

Otherwise Excel tends to take the default formatting of ‘general’ which wipes the zeros when you write the value, regardless of what data type you have (as excel doesn’t have an exact mirror of data types) or what the formatting value is in excel (which is often ignored by the excel api).

You could also try bumblebee package which has some helpful tools to expose more options via the api.


Thaaaaaank you very much Jacob,

That worked like a charm!!!

1 Like