Jump to content
Macro Express Forums

Converting Excel Files to CSV


Recommended Posts

Hello all,

 

Quite some time ago I asked the question: How do I convert an Excel file to a CSV invisibly?

 

The answer pretty well came back in this Earlier Topic that I cannot do so.

 

Ok, that's understandable, if disappointing. It was hinted at, in the above linked post, that I Joe was maybe working on some features for MEP that would make Excel more accessible to MEP.

 

MEP can process the heck out of CSV files, but I can't figure out how to make it dig info from Excel. And I really need it to :)

 

I'm wondering if there is any status update on that front.

 

Thank you!

 

NB: The key here is that I need it to work invisibly - I know I can have the macro process the Excel information if I open the WB and copy the info, but this would defeat the purpose of the macro I'm trying to build. I need to sell the idea of Macro Express to the Head Honchos, and this particular function should be a no-brainer.

Link to comment
Share on other sites

It's real easy. I do it all the time with a simple VBScript. If you can't find an example online just ask and I'll give you an example of one of mine. Except I usually work with TSVs instead of CSVs. Essentially you have it create the object, change to the worksheet desired and export it to a specific file type, and close the object.

 

 

Link to comment
Share on other sites

The trick (besides learning VBScript - which I've been planning on doing "someday" forever) is making it happen without opening the worksheet.

 

Example:

 

I have a list of IP addresses 5 columns wide, 2000 rows deep.

 

Column A is dedicated to the store number; B = Router IP; C = Server IP; D = Printer IP; etc.

 


  •  
  • First, the macro prompts for Store Number, provided by the User, or perhaps grabbed from the trouble-ticket.
  • Second, the macro prompts for the specific IP (router, server, etc.)
  • Third, if the file were a .csv, the macro would process the file, locate the store, and provide the required IP.

 

If I could find a way to make MEP process the spreadsheet exactly the same way as it processes text files, my life would be made simple.

 

Even if I could just find a way to have the macro convert and save the file invisibly to a CSV located on the C: drive, that would be fine.

 

---- I'm thinking that I might just pre-arrange to have the .xls file pre-saved as .csv on my C: drive before the sales-pitch begins, just to keep things smooth. -----

Link to comment
Share on other sites

You don't have to learn VBScript. I really don't know it. I just copied what others have done and made the logical substitution. Took me about 20 minutes to figure out. Works slick!

 

 

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...