Go Back  Xtreme Visual Basic Talk > Legacy Visual Basic (VB 4/5/6) > VBA / Office Integration > Excel > Open csv file, run code, save, quit, repeat 3000ish times.


Reply
 
Thread Tools Display Modes
  #1  
Old 08-27-2008, 04:12 PM
XC MTB XC MTB is offline
Newcomer
 
Join Date: Aug 2008
Posts: 1
Default Open csv file, run code, save, quit, repeat 3000ish times.


I have written some code that I would like to apply to 3000 csv spreadsheets. Do you know what code I would need to have before and after my code to open every csv file in a folder, apply my code and then save and close the file without converting them to xls files?

Any help whatsoever would be greatly appreciated.

Cheers,
Steve
Reply With Quote
  #2  
Old 08-27-2008, 04:24 PM
gpraceman's Avatar
gpraceman gpraceman is offline
Contributor

* Expert *
 
Join Date: Sep 2002
Location: Highlands Ranch, CO
Posts: 556
Default

CSV file is just a text file with commas separating the data. Just use regular File I/O.
__________________
Awana Grand Prix and Pinewood Derby racing - Where a child, an adult and a small block of wood combine for a lot of fun and memories.
Reply With Quote
  #3  
Old 08-28-2008, 02:05 AM
JacquesL JacquesL is offline
Centurion
 
Join Date: Aug 2008
Posts: 116
Default

If I understand you correctly...

Look at:
http://www.w3schools.com/asp/asp_ref_folder.asp

Remove all of the "Server" related stuff since it's ASP VB Script (decent examples though).

Then, do something like...

Code:
For each oFile in f.files
   ...open and process
next
__________________
Jacques
Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Forum Jump

Advertisement:





Free Publications
The ASP.NET 2.0 Anthology
101 Essential Tips, Tricks & Hacks - Free 156 Page Preview. Learn the most practical features and best approaches for ASP.NET.
subscribe
Programmers Heaven C# School Book -Free 338 Page eBook
The Programmers Heaven C# School book covers the .NET framework and the C# language.
subscribe
Build Your Own ASP.NET 3.5 Web Site Using C# & VB, 3rd Edition - Free 219 Page Preview!
This comprehensive step-by-step guide will help get your database-driven ASP.NET web site up and running in no time..
subscribe
 
 
-->