Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

create excell and modify properties

Status
Not open for further replies.

ShadowFox333

Programmer
Oct 15, 2002
97
US
I need to read a .csv file into excel and then change the properties of a numeric field to zip and save as a native mode.xls any ideas out there.
Thanks Bob
 
What have you so far ?
Try a keyword search in this forum for excel.application

Hope This Help, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884
 
There are a couple of methods given in thread329-782027

What did you mean by "zip?" Were you just saying you wanted to make a zip archive of the resulting xls file?
 
Dil
One of the fields(cells) is a numeric field. Actually a zip code. Leading zeroes are stripped unless you set the field property to zip. Then the cell retains the leading zero.
Bob
 
Oh! Sorry.

Well can't you just set objWS.Columns("A:A").NumberFormat = "00000" to get the desired result?

I'm no Excel expert, but... When I manually set the named format to "Zip" vis the Format Cells dialog and then fetch the cell's Numberformat property in a macro I get back "00000" and not the word "Zip.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top