You state that you are creating an Excel file... Is that an actual Excel binary file or is it a CSV file?
As Barney stated, Excel isn't going to allow a number with leading zeros. You can format to display zeros in any app including Excel, but formatting and actual data content are 2 different beasts. If your users will be importing the data into their accounting software as a true number, then who cares if it has leading zeros. I'm sure that the accounting database will not store a number with leading zeros anyway. If it does, then it is text, not numeric. If you are creating CSV content that is streamed and opened in Excel, you can use ="0001234" and Excel will display the leading zeros. Keep in mind that even though Excel displays it as you wish, the CSV content still contains ="0001234". So... col1,col2 1,="001" will display as you wish in Excel, but sure won't import straight into the accounting package. If the users are reviewing the data and possibly modifying before importing, then they can open in Excel using the above format, make their changes and save. When Excel save the file, the equal and double quotes are stripped and the new CSV content will be: col1,col2 1,001 which should import into most anything. But guess what? If they reopen the file in Excel, the leading zeros are gone! I think you really need to decide on what your requirement is; text formatted with leading zeros or an actual numeric value. Terry > I am creating an excel file in cf7 and all works well except when a > part number begins with a 0 - i need the number to always have 5 > digits as in 01234 or 12345. > > i have tried doing a Numberformat(partnum, '00000') to no avail. > > can i force using "TabChar" or something? > > noticed the the field in the created excel file will not accept a 0 > even typed in manually. > > thanks in advance ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~| Create robust enterprise, web RIAs. Upgrade to ColdFusion 8 and integrate with Adobe Flex http://www.adobe.com/products/coldfusion/flex2/?sdid=RVJP Archive: http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:288504 Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4

