Link to home
Start Free TrialLog in
Avatar of jennieh
jennieh

asked on

Excel.Application casting data types

I'm using Excel.Application to create a spreadsheet from within an asp page. One of the columns contains 5 character codes which should be treated as text, but sometimes they are numeric and have leading zeros, which Excel removes when the spreadsheet is opened. How do I cast the data type of this column as text so that the zeros will be displayed?
ASKER CERTIFIED SOLUTION
Avatar of lavinder
lavinder

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of jennieh
jennieh

ASKER

I used the following and it worked:

m_oExcelWS.Range("F:F").NumberFormat = "@"

Thanks very much!!!