Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 8
Default Adding text after save

I have a spreadsheet that is saved as a .csv and then sent to a customer
(info contains their product in storage). [Saving the workbook via vba is no
problem]. My trouble lies in the fiirst line of the .csv file which must
contain specific ICC data (with specific spacing/positioning) information.
The data is as below:

Dim myStr As String
myStr = "{ICC}DATBOOK" & Space(1) & "ZZ:CJKUSA" & Space(9) &
"ZZ:MGHDATA" & Space(9) & Date & Time

My problem is how to insert this information into line 1 after the file is
saved to csv (in vba)
I want this to occur automaticly for my user.

Any thought??
Rick
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default Adding text after save

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

believe you would have to read the file and write a new one inserting the
line. This assumes you can't insert that line at the top of the data in
Excel before saving.

--
Regards,
Tom Ogilvy


"Rick K" wrote in message
...
I have a spreadsheet that is saved as a .csv and then sent to a customer
(info contains their product in storage). [Saving the workbook via vba is

no
problem]. My trouble lies in the fiirst line of the .csv file which must
contain specific ICC data (with specific spacing/positioning) information.
The data is as below:

Dim myStr As String
myStr = "{ICC}DATBOOK" & Space(1) & "ZZ:CJKUSA" & Space(9) &
"ZZ:MGHDATA" & Space(9) & Date & Time

My problem is how to insert this information into line 1 after the file is
saved to csv (in vba)
I want this to occur automaticly for my user.

Any thought??
Rick



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 694
Default Adding text after save

Hi,

You could use the SaveCopyAs method:
- say you have book1.xls open
- do a SaveCopyAs on book1.xls into mybook.xls
- the result is : you still have book1.xls open and it has been saved into a
copy mybook.xls

so for you case:
- say your book is book1.xls
- change {ICC}
- SaveCopyAs into a csv file, say book_for_customer1.csv
[book1.xls is still open]
- rollover the generic {ICC} tag
[book1 is now as i first was before this process started]

Would that work for you?
--
Regards,
Sébastien
<http://www.ondemandanalysis.com


"Rick K" wrote:

I have a spreadsheet that is saved as a .csv and then sent to a customer
(info contains their product in storage). [Saving the workbook via vba is no
problem]. My trouble lies in the fiirst line of the .csv file which must
contain specific ICC data (with specific spacing/positioning) information.
The data is as below:

Dim myStr As String
myStr = "{ICC}DATBOOK" & Space(1) & "ZZ:CJKUSA" & Space(9) &
"ZZ:MGHDATA" & Space(9) & Date & Time

My problem is how to insert this information into line 1 after the file is
saved to csv (in vba)
I want this to occur automaticly for my user.

Any thought??
Rick

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
Forgot to save a workbook after adding additional info Susan Excel Discussion (Misc queries) 3 January 12th 08 04:42 AM
after adding data, grafics not calculated until save and reload jbz Charts and Charting in Excel 0 May 3rd 06 10:10 PM
Adding a worksheet from a date named workbook and save as current Lynn Bales Excel Programming 0 July 20th 05 01:35 PM
adding before save so it works every time excel opens and with any workbook Job[_2_] Excel Programming 3 January 12th 05 10:13 PM
Save As - Multiple Sheets fails to save as text file Ravee Srinivasan Excel Programming 2 November 10th 03 04:05 PM


All times are GMT +1. The time now is 03:16 AM.

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"