|
-
Oct 24th, 2001, 02:27 AM
#1
Thread Starter
New Member
creating csv file at runtime
I was just enquiring if anybody know how to create csv files in excel at run time. I have a feeling it's just a matter of open up an excel object and then 'saving as' a csv file. Im not sure though so if any one can help it would be much appreciated.
Just remembered. I would also like to know how to append an attatchment to an outlook message object.
Thanks again
-
Oct 24th, 2001, 02:50 AM
#2
Retired VBF Adm1nistrator
You just want to create a comma delimeted file when an app loads is it ?
Microsoft MVP : Visual Developer - Visual Basic [2004-2005]
-
Oct 24th, 2001, 06:43 PM
#3
Thread Starter
New Member
yeah, when the form loads up i need to create a csv file and populate it. Im just not sure what syntax to use with the "Saveas" method of the worksheet object. See i've created a new instance of excel and am just going to try and save as csv file.
I would also like to know the syntax to append an attatchment to an outlook mail object.
Any help would e much appreciated.
-
Oct 24th, 2001, 09:21 PM
#4
Fanatic Member
Do you need to do this in VB or in Excel using VBA?
I would think VB would be easier because you can just open a file for output and then save each line of the CVS with a print statement.
If you need to do this in Excel turn the macro recorder on and then do a couple of operations you want to do in your program and then save as CVS file, then take a look at the macro that was recorded.
-
Oct 25th, 2001, 02:18 AM
#5
Retired VBF Adm1nistrator
Yeah as steve said, all you do is open up the file for output and print to it and put commas between the fields
Microsoft MVP : Visual Developer - Visual Basic [2004-2005]
-
Nov 29th, 2001, 08:09 AM
#6
New Member
' -- Tell the browser the data is a Comma Separated Values List (CSV)
response.ContentType="application/csv"
' -- Tell the browser to associate a file name with the data
Response.AddHeader "Content-Disposition", "filename=anytext.csv;"
Then use response.write to fill a cell, writing a comma to indicate to jump to the next column. Use response.write vbnewline to move to the next row.
Allow myself to introduce...myself.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|