#1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default CSV

I'm using VBScript to create a csv file.

I have a zip code field, that keeps being imported as
general and therefore, drops the first zero.

I have tried to replace the string with &Chr(34) to create
double quotes.

Is there a way in vbscript to specify the TYPE of field on
IMPORT, so when the csv is created, it will specify a
field as text?

Basically, If I import a txt file into excel, I can
specify each field type. Can I do it in vbscript code?
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default CSV

There is no way to do this for outputting a file.

If you open the file as a CSV file, then excel will perform its own
interpretation.

Rename the file as .Txt and open it with the opentext method and specify the
column types, or us low level file io to open it and parse it with your
code.

Regards,
Tom Ogilvy


Darren wrote in message
...
I'm using VBScript to create a csv file.

I have a zip code field, that keeps being imported as
general and therefore, drops the first zero.

I have tried to replace the string with &Chr(34) to create
double quotes.

Is there a way in vbscript to specify the TYPE of field on
IMPORT, so when the csv is created, it will specify a
field as text?

Basically, If I import a txt file into excel, I can
specify each field type. Can I do it in vbscript code?



Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT +1. The time now is 07:05 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"