File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Other Languages and the fly likes How to access .csv files through Excel macro? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Languages » Other Languages
Bookmark "How to access .csv files through Excel macro?" Watch "How to access .csv files through Excel macro?" New topic

How to access .csv files through Excel macro?

Mani Raju
Ranch Hand

Joined: Oct 09, 2012
Posts: 46
I required to access ".csv" file through Excel macro!

Any one could you please help to create macro in excel to access content of ".csv" format file!

Thanks in advance!

Tony Docherty

Joined: Aug 07, 2007
Posts: 2830
This has nothing to do with Java so I'll move this thread to our Other Languages forum.
Piet Souris
Ranch Hand

Joined: Mar 08, 2009
Posts: 966
You can open a ".csv" file in Excel directly. So what's the problem?

You may have to apply the menu option "text to columns, but that'll take you a couple of seconds at most.

If you MUST open a csv file in VBA, then just start recording a macro, open the file in the usual way,
do the text to columns if necessary, stop your macro and look at the generated code. That's often the fastest
way to learn VBA.
Having loaded this csv file into a sheet, you can read all of it using standard VBA code.
I agree. Here's the link:
subject: How to access .csv files through Excel macro?
It's not a secret anymore!