Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 6
Default OpenText looses leading zeros for zip

I've tried
objExcel.ActiveWorkbook.Activesheet.Columns("L").N umberFormat = "@"
and no luck.

I also tried the FieldInfo Array of Arrays for OpenText.

I'm using vbs and I'm looking for a way to not loose leading zeros? Thanks!


  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 339
Default OpenText looses leading zeros for zip


"Salty Dog" wrote in message
...
I've tried
objExcel.ActiveWorkbook.Activesheet.Columns("L").N umberFormat = "@"
and no luck.

I also tried the FieldInfo Array of Arrays for OpenText.

I'm using vbs and I'm looking for a way to not loose leading zeros?

Thanks!

Use an apostrophe as the first character, i.e '01 rather than 01
/Fredrik


  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 6
Default OpenText looses leading zeros for zip

I tried adding a leading apostrophe and the zero is there but now how do I
get rid of the apostrophe? What is interesting is that if I use NumberFormat
for say currency on a column the formatting will stick. When I do a
NumberFormat = "@" then when I open the resulting spreadsheet, the formatting
is still general. If I can programmatically set the format to text, then
removing any extra leading character would be simple and problem solved. I
can't seem to get the text format to stick programmatically. Thanks!

"Fredrik Wahlgren" wrote:


"Salty Dog" wrote in message
...
I've tried
objExcel.ActiveWorkbook.Activesheet.Columns("L").N umberFormat = "@"
and no luck.

I also tried the FieldInfo Array of Arrays for OpenText.

I'm using vbs and I'm looking for a way to not loose leading zeros?

Thanks!

Use an apostrophe as the first character, i.e '01 rather than 01
/Fredrik



  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default OpenText looses leading zeros for zip

If a CSV, OpenText doesn't pay any attention to you settings. Change the
name of the file to have a .txt extension and use the settings in OpenText
to tell excel to treat that column as Text.

If you can't get that to work, you can format the column as

objExcel.ActiveWorkbook.Activesheet.Columns("L").N umberFormat = "00000"

or loop through each cell and do something like

cell.Vaue = "'" & Right("00000" & cell.Value,5)

--
Regards,
Tom Ogilvy

"Salty Dog" wrote in message
...
I've tried
objExcel.ActiveWorkbook.Activesheet.Columns("L").N umberFormat = "@"
and no luck.

I also tried the FieldInfo Array of Arrays for OpenText.

I'm using vbs and I'm looking for a way to not loose leading zeros?

Thanks!




  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 6
Default OpenText looses leading zeros for zip

I appreciate the help but my file already has a .txt extension, I have
international postal codes so the fixed format does not apply, and I have
tried the OpenText FieldInfo settings. The code does not error when I
formatnumber="@", but the column does not appear/stay formatted as text.
Same with the OpenText FieldInfo try. Thanks!

"Tom Ogilvy" wrote:

If a CSV, OpenText doesn't pay any attention to you settings. Change the
name of the file to have a .txt extension and use the settings in OpenText
to tell excel to treat that column as Text.

If you can't get that to work, you can format the column as

objExcel.ActiveWorkbook.Activesheet.Columns("L").N umberFormat = "00000"

or loop through each cell and do something like

cell.Vaue = "'" & Right("00000" & cell.Value,5)

--
Regards,
Tom Ogilvy

"Salty Dog" wrote in message
...
I've tried
objExcel.ActiveWorkbook.Activesheet.Columns("L").N umberFormat = "@"
and no luck.

I also tried the FieldInfo Array of Arrays for OpenText.

I'm using vbs and I'm looking for a way to not loose leading zeros?

Thanks!







  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default OpenText looses leading zeros for zip

Formatting does not change arbitrarily. Also, formatting a column after the
data is already there does nothing to the existing data. The zero is gone
at that time. It would be interesting to know how you determine if the
formatting is still there or not. Looking at it is not the correct answer.



--
Regards,
Tom Ogilvy

"Salty Dog" wrote in message
...
I appreciate the help but my file already has a .txt extension, I have
international postal codes so the fixed format does not apply, and I have
tried the OpenText FieldInfo settings. The code does not error when I
formatnumber="@", but the column does not appear/stay formatted as text.
Same with the OpenText FieldInfo try. Thanks!

"Tom Ogilvy" wrote:

If a CSV, OpenText doesn't pay any attention to you settings. Change

the
name of the file to have a .txt extension and use the settings in

OpenText
to tell excel to treat that column as Text.

If you can't get that to work, you can format the column as

objExcel.ActiveWorkbook.Activesheet.Columns("L").N umberFormat = "00000"

or loop through each cell and do something like

cell.Vaue = "'" & Right("00000" & cell.Value,5)

--
Regards,
Tom Ogilvy

"Salty Dog" wrote in message
...
I've tried
objExcel.ActiveWorkbook.Activesheet.Columns("L").N umberFormat = "@"
and no luck.

I also tried the FieldInfo Array of Arrays for OpenText.

I'm using vbs and I'm looking for a way to not loose leading zeros?

Thanks!







  #7   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 6
Default OpenText looses leading zeros for zip

If you manually right-click and format cell and save/click OK, then when you
go back to right-click the cell it will show the new formatting.

If I programmitically set the formatting then by right-clicking cells
format cells does not show that the cell is formatted as text.

Thanks!

"Tom Ogilvy" wrote:

Formatting does not change arbitrarily. Also, formatting a column after the
data is already there does nothing to the existing data. The zero is gone
at that time. It would be interesting to know how you determine if the
formatting is still there or not. Looking at it is not the correct answer.



--
Regards,
Tom Ogilvy

"Salty Dog" wrote in message
...
I appreciate the help but my file already has a .txt extension, I have
international postal codes so the fixed format does not apply, and I have
tried the OpenText FieldInfo settings. The code does not error when I
formatnumber="@", but the column does not appear/stay formatted as text.
Same with the OpenText FieldInfo try. Thanks!

"Tom Ogilvy" wrote:

If a CSV, OpenText doesn't pay any attention to you settings. Change

the
name of the file to have a .txt extension and use the settings in

OpenText
to tell excel to treat that column as Text.

If you can't get that to work, you can format the column as

objExcel.ActiveWorkbook.Activesheet.Columns("L").N umberFormat = "00000"

or loop through each cell and do something like

cell.Vaue = "'" & Right("00000" & cell.Value,5)

--
Regards,
Tom Ogilvy

"Salty Dog" wrote in message
...
I've tried
objExcel.ActiveWorkbook.Activesheet.Columns("L").N umberFormat = "@"
and no luck.

I also tried the FieldInfo Array of Arrays for OpenText.

I'm using vbs and I'm looking for a way to not loose leading zeros?
Thanks!








  #8   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default OpenText looses leading zeros for zip

If I programmitically set the formatting then by right-clicking cells
format cells does not show that the cell is formatted as text.


It does for me.

--
Regards,
Tom Ogilvy



"Salty Dog" wrote in message
...
If you manually right-click and format cell and save/click OK, then when

you
go back to right-click the cell it will show the new formatting.

If I programmitically set the formatting then by right-clicking cells
format cells does not show that the cell is formatted as text.

Thanks!

"Tom Ogilvy" wrote:

Formatting does not change arbitrarily. Also, formatting a column after

the
data is already there does nothing to the existing data. The zero is

gone
at that time. It would be interesting to know how you determine if the
formatting is still there or not. Looking at it is not the correct

answer.



--
Regards,
Tom Ogilvy

"Salty Dog" wrote in message
...
I appreciate the help but my file already has a .txt extension, I have
international postal codes so the fixed format does not apply, and I

have
tried the OpenText FieldInfo settings. The code does not error when I
formatnumber="@", but the column does not appear/stay formatted as

text.
Same with the OpenText FieldInfo try. Thanks!

"Tom Ogilvy" wrote:

If a CSV, OpenText doesn't pay any attention to you settings.

Change
the
name of the file to have a .txt extension and use the settings in

OpenText
to tell excel to treat that column as Text.

If you can't get that to work, you can format the column as

objExcel.ActiveWorkbook.Activesheet.Columns("L").N umberFormat =

"00000"

or loop through each cell and do something like

cell.Vaue = "'" & Right("00000" & cell.Value,5)

--
Regards,
Tom Ogilvy

"Salty Dog" wrote in message
...
I've tried
objExcel.ActiveWorkbook.Activesheet.Columns("L").N umberFormat =

"@"
and no luck.

I also tried the FieldInfo Array of Arrays for OpenText.

I'm using vbs and I'm looking for a way to not loose leading

zeros?
Thanks!










  #9   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 6
Default OpenText looses leading zeros for zip

Got it. The resulting file was being saved back as the original file format
which stripped all of the, turns out, successful formatting.

Thanks for all your help!!!

"Tom Ogilvy" wrote:

If I programmitically set the formatting then by right-clicking cells
format cells does not show that the cell is formatted as text.


It does for me.

--
Regards,
Tom Ogilvy



"Salty Dog" wrote in message
...
If you manually right-click and format cell and save/click OK, then when

you
go back to right-click the cell it will show the new formatting.

If I programmitically set the formatting then by right-clicking cells
format cells does not show that the cell is formatted as text.

Thanks!

"Tom Ogilvy" wrote:

Formatting does not change arbitrarily. Also, formatting a column after

the
data is already there does nothing to the existing data. The zero is

gone
at that time. It would be interesting to know how you determine if the
formatting is still there or not. Looking at it is not the correct

answer.



--
Regards,
Tom Ogilvy

"Salty Dog" wrote in message
...
I appreciate the help but my file already has a .txt extension, I have
international postal codes so the fixed format does not apply, and I

have
tried the OpenText FieldInfo settings. The code does not error when I
formatnumber="@", but the column does not appear/stay formatted as

text.
Same with the OpenText FieldInfo try. Thanks!

"Tom Ogilvy" wrote:

If a CSV, OpenText doesn't pay any attention to you settings.

Change
the
name of the file to have a .txt extension and use the settings in
OpenText
to tell excel to treat that column as Text.

If you can't get that to work, you can format the column as

objExcel.ActiveWorkbook.Activesheet.Columns("L").N umberFormat =

"00000"

or loop through each cell and do something like

cell.Vaue = "'" & Right("00000" & cell.Value,5)

--
Regards,
Tom Ogilvy

"Salty Dog" wrote in message
...
I've tried
objExcel.ActiveWorkbook.Activesheet.Columns("L").N umberFormat =

"@"
and no luck.

I also tried the FieldInfo Array of Arrays for OpenText.

I'm using vbs and I'm looking for a way to not loose leading

zeros?
Thanks!











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


Similar Threads
Thread Thread Starter Forum Replies Last Post
Leading zeros mary Excel Discussion (Misc queries) 1 January 18th 06 01:56 PM
Leading zeros Paul Excel Discussion (Misc queries) 4 June 12th 05 04:04 AM
save text field w/ leading zeros in .csv format & not lose zeros? Ques Excel Discussion (Misc queries) 1 May 4th 05 06:21 PM
Pad with leading zeros? 43fan Excel Programming 5 April 23rd 04 06:11 PM
After OpenText all pastes from external apps use format from OpenText Jim[_31_] Excel Programming 1 November 8th 03 02:17 AM


All times are GMT +1. The time now is 07:16 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"