ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Probelm with Data formatting (https://www.excelbanter.com/excel-programming/276563-probelm-data-formatting.html)

amit[_2_]

Probelm with Data formatting
 
Anyone who can help me on this issue .
I am posting this issue again

Regards
Amit

Hi ,
I tried what you suggested but it did not work
here the same code i used to laod a text file and sample data file i try
to load
string m_sTempCSVFilePath =
"D:\\abc_051b66ed-532c-4bab-a068-b63eb2c239d8.txt" ;

axSpreadsheet1.ActiveSheet.Cells.get_Item(1,1).
LoadText(m_sTempCSVFilePath,";",false,"' '");

axSpreadsheet1.Show ();

content of abc_051b66ed-532c-4bab-a068-b63eb2c239d8.txt file

CORE DESC;CORE
3" GRNSTRIPE NOTCHED;3GN
3" HVYWALL INSERTED;3HI
3" HVYWALL NO NOTCH;3HP
3" HVYWALL NOTCHED;3HN
3" MEDWALL NO NOTCH;3MP
3" REGWALL INSERTED;3RI
3" REGWALL NO NOTCH;3RP
3" REGWALL NOTCHED;3RN
3" THINWALL NO NOTCH;3TP
3" THINWALL NOTCHED;3TN
3"GRNSTRIPE NO NOTCH;3GP
4" MEDWALL NO NOTCH;4MP
4" REGWALL INSERTED;4RI
4" REGWALL NO NOTCH;4RP
4" REGWALL NOTCHED;4RN
5" MEDWALL NO NOTCH;5MP
5" MEDWALL NOTCHED;5MN
5" REGWALL INSERTED;5RI
5" REGWALL NO NOTCH;5RP
5" REGWALL NOTCHED;5RN
6" HVYWALL NO NOTCH;6HP
6" HVYWALL NOTCHED;6HN
6" REGWALL INSERTED;6RI
6" REGWALL NO NOTCH;6RP
6" REGWALL NOTCHED;6RN
723456789012345A;77W
8" REGWALL NO NOTCH;8RP
8" REGWALL NOTCHED;8RN
FHFHA;76P
NO CORE NEEDED;...
RWQRA;77B
STANDARD LINER CORE;STD


"BrianB" wrote in message
om...
Change the .csv file to .txt - you get more control over input.

Regards
BrianB
================================================



"amit" wrote in message

...
HI ,

I am using following function call to laod a csv file .

axSpreadsheet1.ActiveSheet.Cells.get_Item(1,1).
LoadText(m_sTempCSVFilePath,";",false,"");

axSpreadsheet1.Show();

The probelm I am getting is if data is something like 123456A or 73453P

then
it is taking it as time and showing me junk time like 8/8/1889 11:00AM

..

data like 123456B or 34567B is working fine . Also data like A234567A ,
123A456A is working fine .

If I open CSV file directly in excel it is working fine . Also import

is
working fine

Thanks in Advance

Regards

Amit





BrianB

Probelm with Data formatting
 
Don't really understand your problem. Your code looks wrong. If you
set to record a macro as you open the file you get something like :-
Workbooks.OpenText FileName:= _ ............ etc.

Regards
BrianB
==============================================



"amit" wrote in message
...
Anyone who can help me on this issue .
I am posting this issue again

Regards
Amit

Hi ,
I tried what you suggested but it did not work
here the same code i used to laod a text file and sample data file i try
to load
string m_sTempCSVFilePath =
"D:\\abc_051b66ed-532c-4bab-a068-b63eb2c239d8.txt" ;

axSpreadsheet1.ActiveSheet.Cells.get_Item(1,1).
LoadText(m_sTempCSVFilePath,";",false,"' '");

axSpreadsheet1.Show ();

content of abc_051b66ed-532c-4bab-a068-b63eb2c239d8.txt file

CORE DESC;CORE
3" GRNSTRIPE NOTCHED;3GN
3" HVYWALL INSERTED;3HI
3" HVYWALL NO NOTCH;3HP
3" HVYWALL NOTCHED;3HN
3" MEDWALL NO NOTCH;3MP
3" REGWALL INSERTED;3RI
3" REGWALL NO NOTCH;3RP
3" REGWALL NOTCHED;3RN
3" THINWALL NO NOTCH;3TP
3" THINWALL NOTCHED;3TN
3"GRNSTRIPE NO NOTCH;3GP
4" MEDWALL NO NOTCH;4MP
4" REGWALL INSERTED;4RI
4" REGWALL NO NOTCH;4RP
4" REGWALL NOTCHED;4RN
5" MEDWALL NO NOTCH;5MP
5" MEDWALL NOTCHED;5MN
5" REGWALL INSERTED;5RI
5" REGWALL NO NOTCH;5RP
5" REGWALL NOTCHED;5RN
6" HVYWALL NO NOTCH;6HP
6" HVYWALL NOTCHED;6HN
6" REGWALL INSERTED;6RI
6" REGWALL NO NOTCH;6RP
6" REGWALL NOTCHED;6RN
723456789012345A;77W
8" REGWALL NO NOTCH;8RP
8" REGWALL NOTCHED;8RN
FHFHA;76P
NO CORE NEEDED;...
RWQRA;77B
STANDARD LINER CORE;STD


"BrianB" wrote in message
om...
Change the .csv file to .txt - you get more control over input.

Regards
BrianB
================================================



"amit" wrote in message

...
HI ,

I am using following function call to laod a csv file .

axSpreadsheet1.ActiveSheet.Cells.get_Item(1,1).
LoadText(m_sTempCSVFilePath,";",false,"");

axSpreadsheet1.Show();

The probelm I am getting is if data is something like 123456A or 73453P

then
it is taking it as time and showing me junk time like 8/8/1889 11:00AM

.

data like 123456B or 34567B is working fine . Also data like A234567A ,
123A456A is working fine .

If I open CSV file directly in excel it is working fine . Also import

is
working fine

Thanks in Advance

Regards

Amit



All times are GMT +1. The time now is 01:43 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com