Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 40
Default CSV Header Information

I have an excel program that converts excel files to csv files automatically
using VBA Macros. However, I am wanting to add csv print header information
example:
%!
XGF
9999 SETBUFSIZE
(,) SETDBSEP
QSTRIP_on
(GuntherIPEP.jdt) SETJDT
(IPEP.dbm) STARTDBM

The issue is that it must insert after csv conversion and not register as an
excel record. Is there VBA macros that will accomplish this for me? If so,
what would it be?
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 6,953
Default CSV Header Information

write the file yourself.

here is some starter code:

http://www.cpearson.com/excel/imptext.htm import/export text files

--
Regards,
Tom Ogilvy


"Help?" wrote:

I have an excel program that converts excel files to csv files automatically
using VBA Macros. However, I am wanting to add csv print header information
example:
%!
XGF
9999 SETBUFSIZE
(,) SETDBSEP
QSTRIP_on
(GuntherIPEP.jdt) SETJDT
(IPEP.dbm) STARTDBM

The issue is that it must insert after csv conversion and not register as an
excel record. Is there VBA macros that will accomplish this for me? If so,
what would it be?

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 40
Default CSV Header Information

This is coming up as Page not found.

"Tom Ogilvy" wrote:

write the file yourself.

here is some starter code:

http://www.cpearson.com/excel/imptext.htm import/export text files

--
Regards,
Tom Ogilvy


"Help?" wrote:

I have an excel program that converts excel files to csv files automatically
using VBA Macros. However, I am wanting to add csv print header information
example:
%!
XGF
9999 SETBUFSIZE
(,) SETDBSEP
QSTRIP_on
(GuntherIPEP.jdt) SETJDT
(IPEP.dbm) STARTDBM

The issue is that it must insert after csv conversion and not register as an
excel record. Is there VBA macros that will accomplish this for me? If so,
what would it be?

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 35,218
Default CSV Header Information

Try it again. It works ok for me.

Help? wrote:

This is coming up as Page not found.

"Tom Ogilvy" wrote:

write the file yourself.

here is some starter code:

http://www.cpearson.com/excel/imptext.htm import/export text files

--
Regards,
Tom Ogilvy


"Help?" wrote:

I have an excel program that converts excel files to csv files automatically
using VBA Macros. However, I am wanting to add csv print header information
example:
%!
XGF
9999 SETBUFSIZE
(,) SETDBSEP
QSTRIP_on
(GuntherIPEP.jdt) SETJDT
(IPEP.dbm) STARTDBM

The issue is that it must insert after csv conversion and not register as an
excel record. Is there VBA macros that will accomplish this for me? If so,
what would it be?


--

Dave Peterson
  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 6,953
Default CSV Header Information

I just copied this from the navigation window while viewing the cited page:

http://www.cpearson.com/excel/imptext.htm

--
Regards,
Tom Ogilvy


"Help?" wrote:

This is coming up as Page not found.

"Tom Ogilvy" wrote:

write the file yourself.

here is some starter code:

http://www.cpearson.com/excel/imptext.htm import/export text files

--
Regards,
Tom Ogilvy


"Help?" wrote:

I have an excel program that converts excel files to csv files automatically
using VBA Macros. However, I am wanting to add csv print header information
example:
%!
XGF
9999 SETBUFSIZE
(,) SETDBSEP
QSTRIP_on
(GuntherIPEP.jdt) SETJDT
(IPEP.dbm) STARTDBM

The issue is that it must insert after csv conversion and not register as an
excel record. Is there VBA macros that will accomplish this for me? If so,
what would it be?



  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 40
Default CSV Header Information

Thanks, sorry. Can't seem to get to the below website and what I have is not
working.

"Dave Peterson" wrote:

Try it again. It works ok for me.

Help? wrote:

This is coming up as Page not found.

"Tom Ogilvy" wrote:

write the file yourself.

here is some starter code:

http://www.cpearson.com/excel/imptext.htm import/export text files

--
Regards,
Tom Ogilvy


"Help?" wrote:

I have an excel program that converts excel files to csv files automatically
using VBA Macros. However, I am wanting to add csv print header information
example:
%!
XGF
9999 SETBUFSIZE
(,) SETDBSEP
QSTRIP_on
(GuntherIPEP.jdt) SETJDT
(IPEP.dbm) STARTDBM

The issue is that it must insert after csv conversion and not register as an
excel record. Is there VBA macros that will accomplish this for me? If so,
what would it be?


--

Dave Peterson

  #7   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 6,953
Default CSV Header Information


http://support.microsoft.com/default...b;en-us;151262
Working with Sequential Access Files

http://www.applecore99.com/gen/gen029.asp


http://support.microsoft.com/support...eio/fileio.asp
http://web.archive.org/web/200404050...eio/fileio.asp
File Access with Visual BasicĀ® for Applications


--
Regards,
Tom Ogilvy


"Help?" wrote:

Thanks, sorry. Can't seem to get to the below website and what I have is not
working.

"Dave Peterson" wrote:

Try it again. It works ok for me.

Help? wrote:

This is coming up as Page not found.

"Tom Ogilvy" wrote:

write the file yourself.

here is some starter code:

http://www.cpearson.com/excel/imptext.htm import/export text files

--
Regards,
Tom Ogilvy


"Help?" wrote:

I have an excel program that converts excel files to csv files automatically
using VBA Macros. However, I am wanting to add csv print header information
example:
%!
XGF
9999 SETBUFSIZE
(,) SETDBSEP
QSTRIP_on
(GuntherIPEP.jdt) SETJDT
(IPEP.dbm) STARTDBM

The issue is that it must insert after csv conversion and not register as an
excel record. Is there VBA macros that will accomplish this for me? If so,
what would it be?


--

Dave Peterson

  #8   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 40
Default CSV Header Information

Finally got it! However, my programming is not accomplishing what I need. It
is outputing:
%!,XGF,9999 SETBUFSIZE,"(,) SETDBSEP",QSTRIP_on,(GuntherIPEP.jdt)
SETJDT,(IPEP.dbm)
STARTDBM,EMPLOYER,EE_STATE,EE_ZIP,APP_STATE,GENERI C_KIT_COUNT,START_DATE,END_DATE,PIN_CODE,CEO_LETTE R_OPTION,CEO_LETTER_FROM,CEO_LETTER_TITLE,CEO_LETT ER_DATE,HOW_LETTER_OPTION,HOW_LETTER_DATE,HOW_LETT ER_FROM,HOW_LETTER_TITLE,HOW_LETTER_DEPT,ENROLLMEN T_OPTION,GROUP_MEETINGS_WILL_BE,BENEFIT_COUNSELORS _WILL_BE,WILL_BE_DISTRIBUTED,CALL_CENTER_ENROLL_TE LEPHONE_NUMBER,SELF_SERVE_START_DATE,SELF_SERVE_EN D_DATE,ACCIDENT,CANCER,CI,ISWL,LTC,MEDSUPPORT,STD, TERM_LIFE,VIUL,GROUP_LTC,GROUP_LTD,GROUP_STD,GROUP _TERM_LIFE,WEB_ADDRESS,OTHER1,OTHER2,OTHER3,OTHER4 ,OTHER5
HEADER TESTING,,,,,,,,,,,,,,,,,,,Y,,,,,A,,,,,,,,,,,,,,,,, ,,,,,,,HEADER
TESTING,39024.68396

I need:
%!
XGF,9999 SETBUFSIZE
(,) SETDBSEP",QSTRIP_on
(GuntherIPEP.jdt) SETJDT
(IPEP.dbm) STARTDBM
EMPLOYER,EE_STATE,EE_ZIP,APP_STATE,GENERIC_KIT_COU NT,START_DATE,END_DATE,PIN_CODE,CEO_LETTER_OPTION, CEO_LETTER_FROM,CEO_LETTER_TITLE,CEO_LETTER_DATE,H OW_LETTER_OPTION,HOW_LETTER_DATE,HOW_LETTER_FROM,H OW_LETTER_TITLE,HOW_LETTER_DEPT,ENROLLMENT_OPTION, GROUP_MEETINGS_WILL_BE,BENEFIT_COUNSELORS_WILL_BE, WILL_BE_DISTRIBUTED,CALL_CENTER_ENROLL_TELEPHONE_N UMBER,SELF_SERVE_START_DATE,SELF_SERVE_END_DATE,AC CIDENT,CANCER,CI,ISWL,LTC,MEDSUPPORT,STD,TERM_LIFE ,VIUL,GROUP_LTC,GROUP_LTD,GROUP_STD,GROUP_TERM_LIF E,WEB_ADDRESS,OTHER1,OTHER2,OTHER3,OTHER4,OTHER5
HEADER TESTING,,,,,,,,,,,,,,,,,,,Y,,,,,A,,,,,,,,,,,,,,,,, ,,,,,,,HEADER
TESTING,39024.68396

My programming is:
Dim RowNdx As Integer
Dim ColNdx As Integer
Dim WholeLine As String
Dim FName As String

Application.ScreenUpdating = False

ColNdx = Range("A1").Column
RowNdx = Range("A1").Row
FName = "I:\06vs-EC Standard Kit Request Form\5 Daniel Huffine\Final Fully
Automated\Test new directions\CSV Header testing\FName.txt"
Open FName For Input Access Read As #1

While Not EOF(1)
Line Input #1, WholeLine
Cells(RowNdx, ColNdx).Value = WholeLine
ColNdx = ColNdx + 1

Wend
Close #1

Is their something I am doing wrong?


"Tom Ogilvy" wrote:

I just copied this from the navigation window while viewing the cited page:

http://www.cpearson.com/excel/imptext.htm

--
Regards,
Tom Ogilvy


"Help?" wrote:

This is coming up as Page not found.

"Tom Ogilvy" wrote:

write the file yourself.

here is some starter code:

http://www.cpearson.com/excel/imptext.htm import/export text files

--
Regards,
Tom Ogilvy


"Help?" wrote:

I have an excel program that converts excel files to csv files automatically
using VBA Macros. However, I am wanting to add csv print header information
example:
%!
XGF
9999 SETBUFSIZE
(,) SETDBSEP
QSTRIP_on
(GuntherIPEP.jdt) SETJDT
(IPEP.dbm) STARTDBM

The issue is that it must insert after csv conversion and not register as an
excel record. Is there VBA macros that will accomplish this for me? If so,
what would it be?

  #9   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 6,953
Default CSV Header Information

I thought you said you want to write/create a csv file with your data in it,
adding hour header at the top.

Your code is reading a file and putting it into Excel?

The lower part of the cited page has code to write a file.

--
Regards,
Tom Ogilvy


"Help?" wrote:

Finally got it! However, my programming is not accomplishing what I need. It
is outputing:
%!,XGF,9999 SETBUFSIZE,"(,) SETDBSEP",QSTRIP_on,(GuntherIPEP.jdt)
SETJDT,(IPEP.dbm)
STARTDBM,EMPLOYER,EE_STATE,EE_ZIP,APP_STATE,GENERI C_KIT_COUNT,START_DATE,END_DATE,PIN_CODE,CEO_LETTE R_OPTION,CEO_LETTER_FROM,CEO_LETTER_TITLE,CEO_LETT ER_DATE,HOW_LETTER_OPTION,HOW_LETTER_DATE,HOW_LETT ER_FROM,HOW_LETTER_TITLE,HOW_LETTER_DEPT,ENROLLMEN T_OPTION,GROUP_MEETINGS_WILL_BE,BENEFIT_COUNSELORS _WILL_BE,WILL_BE_DISTRIBUTED,CALL_CENTER_ENROLL_TE LEPHONE_NUMBER,SELF_SERVE_START_DATE,SELF_SERVE_EN D_DATE,ACCIDENT,CANCER,CI,ISWL,LTC,MEDSUPPORT,STD, TERM_LIFE,VIUL,GROUP_LTC,GROUP_LTD,GROUP_STD,GROUP _TERM_LIFE,WEB_ADDRESS,OTHER1,OTHER2,OTHER3,OTHER4 ,OTHER5
HEADER TESTING,,,,,,,,,,,,,,,,,,,Y,,,,,A,,,,,,,,,,,,,,,,, ,,,,,,,HEADER
TESTING,39024.68396

I need:
%!
XGF,9999 SETBUFSIZE
(,) SETDBSEP",QSTRIP_on
(GuntherIPEP.jdt) SETJDT
(IPEP.dbm) STARTDBM
EMPLOYER,EE_STATE,EE_ZIP,APP_STATE,GENERIC_KIT_COU NT,START_DATE,END_DATE,PIN_CODE,CEO_LETTER_OPTION, CEO_LETTER_FROM,CEO_LETTER_TITLE,CEO_LETTER_DATE,H OW_LETTER_OPTION,HOW_LETTER_DATE,HOW_LETTER_FROM,H OW_LETTER_TITLE,HOW_LETTER_DEPT,ENROLLMENT_OPTION, GROUP_MEETINGS_WILL_BE,BENEFIT_COUNSELORS_WILL_BE, WILL_BE_DISTRIBUTED,CALL_CENTER_ENROLL_TELEPHONE_N UMBER,SELF_SERVE_START_DATE,SELF_SERVE_END_DATE,AC CIDENT,CANCER,CI,ISWL,LTC,MEDSUPPORT,STD,TERM_LIFE ,VIUL,GROUP_LTC,GROUP_LTD,GROUP_STD,GROUP_TERM_LIF E,WEB_ADDRESS,OTHER1,OTHER2,OTHER3,OTHER4,OTHER5
HEADER TESTING,,,,,,,,,,,,,,,,,,,Y,,,,,A,,,,,,,,,,,,,,,,, ,,,,,,,HEADER
TESTING,39024.68396

My programming is:
Dim RowNdx As Integer
Dim ColNdx As Integer
Dim WholeLine As String
Dim FName As String

Application.ScreenUpdating = False

ColNdx = Range("A1").Column
RowNdx = Range("A1").Row
FName = "I:\06vs-EC Standard Kit Request Form\5 Daniel Huffine\Final Fully
Automated\Test new directions\CSV Header testing\FName.txt"
Open FName For Input Access Read As #1

While Not EOF(1)
Line Input #1, WholeLine
Cells(RowNdx, ColNdx).Value = WholeLine
ColNdx = ColNdx + 1

Wend
Close #1

Is their something I am doing wrong?


"Tom Ogilvy" wrote:

I just copied this from the navigation window while viewing the cited page:

http://www.cpearson.com/excel/imptext.htm

--
Regards,
Tom Ogilvy


"Help?" wrote:

This is coming up as Page not found.

"Tom Ogilvy" wrote:

write the file yourself.

here is some starter code:

http://www.cpearson.com/excel/imptext.htm import/export text files

--
Regards,
Tom Ogilvy


"Help?" wrote:

I have an excel program that converts excel files to csv files automatically
using VBA Macros. However, I am wanting to add csv print header information
example:
%!
XGF
9999 SETBUFSIZE
(,) SETDBSEP
QSTRIP_on
(GuntherIPEP.jdt) SETJDT
(IPEP.dbm) STARTDBM

The issue is that it must insert after csv conversion and not register as an
excel record. Is there VBA macros that will accomplish this for me? If so,
what would it be?

  #10   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 40
Default CSV Header Information

I apologize, I am not an excel VBA Programmer. I am trying to coordinate this
to help some of our business partners and the websit you pointed me to says
that this was the code to add the header information. Is there any help?

"Tom Ogilvy" wrote:

I thought you said you want to write/create a csv file with your data in it,
adding hour header at the top.

Your code is reading a file and putting it into Excel?

The lower part of the cited page has code to write a file.

--
Regards,
Tom Ogilvy


"Help?" wrote:

Finally got it! However, my programming is not accomplishing what I need. It
is outputing:
%!,XGF,9999 SETBUFSIZE,"(,) SETDBSEP",QSTRIP_on,(GuntherIPEP.jdt)
SETJDT,(IPEP.dbm)
STARTDBM,EMPLOYER,EE_STATE,EE_ZIP,APP_STATE,GENERI C_KIT_COUNT,START_DATE,END_DATE,PIN_CODE,CEO_LETTE R_OPTION,CEO_LETTER_FROM,CEO_LETTER_TITLE,CEO_LETT ER_DATE,HOW_LETTER_OPTION,HOW_LETTER_DATE,HOW_LETT ER_FROM,HOW_LETTER_TITLE,HOW_LETTER_DEPT,ENROLLMEN T_OPTION,GROUP_MEETINGS_WILL_BE,BENEFIT_COUNSELORS _WILL_BE,WILL_BE_DISTRIBUTED,CALL_CENTER_ENROLL_TE LEPHONE_NUMBER,SELF_SERVE_START_DATE,SELF_SERVE_EN D_DATE,ACCIDENT,CANCER,CI,ISWL,LTC,MEDSUPPORT,STD, TERM_LIFE,VIUL,GROUP_LTC,GROUP_LTD,GROUP_STD,GROUP _TERM_LIFE,WEB_ADDRESS,OTHER1,OTHER2,OTHER3,OTHER4 ,OTHER5
HEADER TESTING,,,,,,,,,,,,,,,,,,,Y,,,,,A,,,,,,,,,,,,,,,,, ,,,,,,,HEADER
TESTING,39024.68396

I need:
%!
XGF,9999 SETBUFSIZE
(,) SETDBSEP",QSTRIP_on
(GuntherIPEP.jdt) SETJDT
(IPEP.dbm) STARTDBM
EMPLOYER,EE_STATE,EE_ZIP,APP_STATE,GENERIC_KIT_COU NT,START_DATE,END_DATE,PIN_CODE,CEO_LETTER_OPTION, CEO_LETTER_FROM,CEO_LETTER_TITLE,CEO_LETTER_DATE,H OW_LETTER_OPTION,HOW_LETTER_DATE,HOW_LETTER_FROM,H OW_LETTER_TITLE,HOW_LETTER_DEPT,ENROLLMENT_OPTION, GROUP_MEETINGS_WILL_BE,BENEFIT_COUNSELORS_WILL_BE, WILL_BE_DISTRIBUTED,CALL_CENTER_ENROLL_TELEPHONE_N UMBER,SELF_SERVE_START_DATE,SELF_SERVE_END_DATE,AC CIDENT,CANCER,CI,ISWL,LTC,MEDSUPPORT,STD,TERM_LIFE ,VIUL,GROUP_LTC,GROUP_LTD,GROUP_STD,GROUP_TERM_LIF E,WEB_ADDRESS,OTHER1,OTHER2,OTHER3,OTHER4,OTHER5
HEADER TESTING,,,,,,,,,,,,,,,,,,,Y,,,,,A,,,,,,,,,,,,,,,,, ,,,,,,,HEADER
TESTING,39024.68396

My programming is:
Dim RowNdx As Integer
Dim ColNdx As Integer
Dim WholeLine As String
Dim FName As String

Application.ScreenUpdating = False

ColNdx = Range("A1").Column
RowNdx = Range("A1").Row
FName = "I:\06vs-EC Standard Kit Request Form\5 Daniel Huffine\Final Fully
Automated\Test new directions\CSV Header testing\FName.txt"
Open FName For Input Access Read As #1

While Not EOF(1)
Line Input #1, WholeLine
Cells(RowNdx, ColNdx).Value = WholeLine
ColNdx = ColNdx + 1

Wend
Close #1

Is their something I am doing wrong?


"Tom Ogilvy" wrote:

I just copied this from the navigation window while viewing the cited page:

http://www.cpearson.com/excel/imptext.htm

--
Regards,
Tom Ogilvy


"Help?" wrote:

This is coming up as Page not found.

"Tom Ogilvy" wrote:

write the file yourself.

here is some starter code:

http://www.cpearson.com/excel/imptext.htm import/export text files

--
Regards,
Tom Ogilvy


"Help?" wrote:

I have an excel program that converts excel files to csv files automatically
using VBA Macros. However, I am wanting to add csv print header information
example:
%!
XGF
9999 SETBUFSIZE
(,) SETDBSEP
QSTRIP_on
(GuntherIPEP.jdt) SETJDT
(IPEP.dbm) STARTDBM

The issue is that it must insert after csv conversion and not register as an
excel record. Is there VBA macros that will accomplish this for me? If so,
what would it be?



  #11   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default CSV Header Information

Insert the necessary rows at the top

Put your header information at the top of your worksheet in a single column
(column A), multiple rows.

Then do your save as CSV.

--
Regards,
Tom Ogilvy

"Help?" wrote in message
...
I apologize, I am not an excel VBA Programmer. I am trying to coordinate
this
to help some of our business partners and the websit you pointed me to
says
that this was the code to add the header information. Is there any help?

"Tom Ogilvy" wrote:

I thought you said you want to write/create a csv file with your data in
it,
adding hour header at the top.

Your code is reading a file and putting it into Excel?

The lower part of the cited page has code to write a file.

--
Regards,
Tom Ogilvy


"Help?" wrote:

Finally got it! However, my programming is not accomplishing what I
need. It
is outputing:
%!,XGF,9999 SETBUFSIZE,"(,) SETDBSEP",QSTRIP_on,(GuntherIPEP.jdt)
SETJDT,(IPEP.dbm)
STARTDBM,EMPLOYER,EE_STATE,EE_ZIP,APP_STATE,GENERI C_KIT_COUNT,START_DATE,END_DATE,PIN_CODE,CEO_LETTE R_OPTION,CEO_LETTER_FROM,CEO_LETTER_TITLE,CEO_LETT ER_DATE,HOW_LETTER_OPTION,HOW_LETTER_DATE,HOW_LETT ER_FROM,HOW_LETTER_TITLE,HOW_LETTER_DEPT,ENROLLMEN T_OPTION,GROUP_MEETINGS_WILL_BE,BENEFIT_COUNSELORS _WILL_BE,WILL_BE_DISTRIBUTED,CALL_CENTER_ENROLL_TE LEPHONE_NUMBER,SELF_SERVE_START_DATE,SELF_SERVE_EN D_DATE,ACCIDENT,CANCER,CI,ISWL,LTC,MEDSUPPORT,STD, TERM_LIFE,VIUL,GROUP_LTC,GROUP_LTD,GROUP_STD,GROUP _TERM_LIFE,WEB_ADDRESS,OTHER1,OTHER2,OTHER3,OTHER4 ,OTHER5
HEADER TESTING,,,,,,,,,,,,,,,,,,,Y,,,,,A,,,,,,,,,,,,,,,,, ,,,,,,,HEADER
TESTING,39024.68396

I need:
%!
XGF,9999 SETBUFSIZE
(,) SETDBSEP",QSTRIP_on
(GuntherIPEP.jdt) SETJDT
(IPEP.dbm) STARTDBM
EMPLOYER,EE_STATE,EE_ZIP,APP_STATE,GENERIC_KIT_COU NT,START_DATE,END_DATE,PIN_CODE,CEO_LETTER_OPTION, CEO_LETTER_FROM,CEO_LETTER_TITLE,CEO_LETTER_DATE,H OW_LETTER_OPTION,HOW_LETTER_DATE,HOW_LETTER_FROM,H OW_LETTER_TITLE,HOW_LETTER_DEPT,ENROLLMENT_OPTION, GROUP_MEETINGS_WILL_BE,BENEFIT_COUNSELORS_WILL_BE, WILL_BE_DISTRIBUTED,CALL_CENTER_ENROLL_TELEPHONE_N UMBER,SELF_SERVE_START_DATE,SELF_SERVE_END_DATE,AC CIDENT,CANCER,CI,ISWL,LTC,MEDSUPPORT,STD,TERM_LIFE ,VIUL,GROUP_LTC,GROUP_LTD,GROUP_STD,GROUP_TERM_LIF E,WEB_ADDRESS,OTHER1,OTHER2,OTHER3,OTHER4,OTHER5
HEADER TESTING,,,,,,,,,,,,,,,,,,,Y,,,,,A,,,,,,,,,,,,,,,,, ,,,,,,,HEADER
TESTING,39024.68396

My programming is:
Dim RowNdx As Integer
Dim ColNdx As Integer
Dim WholeLine As String
Dim FName As String

Application.ScreenUpdating = False

ColNdx = Range("A1").Column
RowNdx = Range("A1").Row
FName = "I:\06vs-EC Standard Kit Request Form\5 Daniel Huffine\Final
Fully
Automated\Test new directions\CSV Header testing\FName.txt"
Open FName For Input Access Read As #1

While Not EOF(1)
Line Input #1, WholeLine
Cells(RowNdx, ColNdx).Value = WholeLine
ColNdx = ColNdx + 1

Wend
Close #1

Is their something I am doing wrong?


"Tom Ogilvy" wrote:

I just copied this from the navigation window while viewing the cited
page:

http://www.cpearson.com/excel/imptext.htm

--
Regards,
Tom Ogilvy


"Help?" wrote:

This is coming up as Page not found.

"Tom Ogilvy" wrote:

write the file yourself.

here is some starter code:

http://www.cpearson.com/excel/imptext.htm import/export text
files

--
Regards,
Tom Ogilvy


"Help?" wrote:

I have an excel program that converts excel files to csv files
automatically
using VBA Macros. However, I am wanting to add csv print header
information
example:
%!
XGF
9999 SETBUFSIZE
(,) SETDBSEP
QSTRIP_on
(GuntherIPEP.jdt) SETJDT
(IPEP.dbm) STARTDBM

The issue is that it must insert after csv conversion and not
register as an
excel record. Is there VBA macros that will accomplish this for
me? If so,
what would it be?



  #12   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 40
Default CSV Header Information

I have tried this. The header information needs to only be recognized by the
printing program and not as a record in the xlcsv. That's why I was pulling
in as text. Once the csv conversion had taken place, pulling in the header
information as text allowed it to not be recognized as records. However, it
would show in the wrong order. See the example below. It is either pulling in
the information side by side or it will pull in the first column. It wouldn't
work that way. Any ideas?

"Tom Ogilvy" wrote:

Insert the necessary rows at the top

Put your header information at the top of your worksheet in a single column
(column A), multiple rows.

Then do your save as CSV.

--
Regards,
Tom Ogilvy

"Help?" wrote in message
...
I apologize, I am not an excel VBA Programmer. I am trying to coordinate
this
to help some of our business partners and the websit you pointed me to
says
that this was the code to add the header information. Is there any help?

"Tom Ogilvy" wrote:

I thought you said you want to write/create a csv file with your data in
it,
adding hour header at the top.

Your code is reading a file and putting it into Excel?

The lower part of the cited page has code to write a file.

--
Regards,
Tom Ogilvy


"Help?" wrote:

Finally got it! However, my programming is not accomplishing what I
need. It
is outputing:
%!,XGF,9999 SETBUFSIZE,"(,) SETDBSEP",QSTRIP_on,(GuntherIPEP.jdt)
SETJDT,(IPEP.dbm)
STARTDBM,EMPLOYER,EE_STATE,EE_ZIP,APP_STATE,GENERI C_KIT_COUNT,START_DATE,END_DATE,PIN_CODE,CEO_LETTE R_OPTION,CEO_LETTER_FROM,CEO_LETTER_TITLE,CEO_LETT ER_DATE,HOW_LETTER_OPTION,HOW_LETTER_DATE,HOW_LETT ER_FROM,HOW_LETTER_TITLE,HOW_LETTER_DEPT,ENROLLMEN T_OPTION,GROUP_MEETINGS_WILL_BE,BENEFIT_COUNSELORS _WILL_BE,WILL_BE_DISTRIBUTED,CALL_CENTER_ENROLL_TE LEPHONE_NUMBER,SELF_SERVE_START_DATE,SELF_SERVE_EN D_DATE,ACCIDENT,CANCER,CI,ISWL,LTC,MEDSUPPORT,STD, TERM_LIFE,VIUL,GROUP_LTC,GROUP_LTD,GROUP_STD,GROUP _TERM_LIFE,WEB_ADDRESS,OTHER1,OTHER2,OTHER3,OTHER4 ,OTHER5
HEADER TESTING,,,,,,,,,,,,,,,,,,,Y,,,,,A,,,,,,,,,,,,,,,,, ,,,,,,,HEADER
TESTING,39024.68396

I need:
%!
XGF,9999 SETBUFSIZE
(,) SETDBSEP",QSTRIP_on
(GuntherIPEP.jdt) SETJDT
(IPEP.dbm) STARTDBM
EMPLOYER,EE_STATE,EE_ZIP,APP_STATE,GENERIC_KIT_COU NT,START_DATE,END_DATE,PIN_CODE,CEO_LETTER_OPTION, CEO_LETTER_FROM,CEO_LETTER_TITLE,CEO_LETTER_DATE,H OW_LETTER_OPTION,HOW_LETTER_DATE,HOW_LETTER_FROM,H OW_LETTER_TITLE,HOW_LETTER_DEPT,ENROLLMENT_OPTION, GROUP_MEETINGS_WILL_BE,BENEFIT_COUNSELORS_WILL_BE, WILL_BE_DISTRIBUTED,CALL_CENTER_ENROLL_TELEPHONE_N UMBER,SELF_SERVE_START_DATE,SELF_SERVE_END_DATE,AC CIDENT,CANCER,CI,ISWL,LTC,MEDSUPPORT,STD,TERM_LIFE ,VIUL,GROUP_LTC,GROUP_LTD,GROUP_STD,GROUP_TERM_LIF E,WEB_ADDRESS,OTHER1,OTHER2,OTHER3,OTHER4,OTHER5
HEADER TESTING,,,,,,,,,,,,,,,,,,,Y,,,,,A,,,,,,,,,,,,,,,,, ,,,,,,,HEADER
TESTING,39024.68396

My programming is:
Dim RowNdx As Integer
Dim ColNdx As Integer
Dim WholeLine As String
Dim FName As String

Application.ScreenUpdating = False

ColNdx = Range("A1").Column
RowNdx = Range("A1").Row
FName = "I:\06vs-EC Standard Kit Request Form\5 Daniel Huffine\Final
Fully
Automated\Test new directions\CSV Header testing\FName.txt"
Open FName For Input Access Read As #1

While Not EOF(1)
Line Input #1, WholeLine
Cells(RowNdx, ColNdx).Value = WholeLine
ColNdx = ColNdx + 1

Wend
Close #1

Is their something I am doing wrong?


"Tom Ogilvy" wrote:

I just copied this from the navigation window while viewing the cited
page:

http://www.cpearson.com/excel/imptext.htm

--
Regards,
Tom Ogilvy


"Help?" wrote:

This is coming up as Page not found.

"Tom Ogilvy" wrote:

write the file yourself.

here is some starter code:

http://www.cpearson.com/excel/imptext.htm import/export text
files

--
Regards,
Tom Ogilvy


"Help?" wrote:

I have an excel program that converts excel files to csv files
automatically
using VBA Macros. However, I am wanting to add csv print header
information
example:
%!
XGF
9999 SETBUFSIZE
(,) SETDBSEP
QSTRIP_on
(GuntherIPEP.jdt) SETJDT
(IPEP.dbm) STARTDBM

The issue is that it must insert after csv conversion and not
register as an
excel record. Is there VBA macros that will accomplish this for
me? If so,
what would it be?




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
Header Information Belin Excel Worksheet Functions 2 May 29th 10 07:36 PM
in Excel is it possible to have header information show in a cell BobKoz Excel Discussion (Misc queries) 0 August 15th 07 08:36 PM
Return Side and Header information from table? SteveT Excel Worksheet Functions 4 February 22nd 07 06:17 AM
How do I add header information to an Excel file? In other words,. Alvin M. New Users to Excel 2 January 26th 05 06:33 PM
Updating Header Information via VBA Brock[_2_] Excel Programming 5 June 2nd 04 05:35 PM


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

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

About Us

"It's about Microsoft Excel"