Go Back   TechArena Community > Software > Software Development
Become a Member!
Forgot your username/password?
Register Tags Active Topics RSS Search Mark Forums Read

Sponsored Links



VB Script or batch file to run Excel Macro 2010

Software Development


Reply
 
Thread Tools Search this Thread
  #1  
Old 18-06-2012
Member
 
Join Date: Apr 2012
Posts: 24
VB Script or batch file to run Excel Macro 2010
  

Is it really possible and is there any way to create a batch file or a VB script that could open the .csv file and then run the macro. Actually there are certain doubts that are going around in my mind. I do have a Computer Aided Software which produces a .CSV file. What I did is recorded the Macro which use to in turn cleans up the file smoothly as those created files were too basic and simple. The macro was so simple that I am able to run it without any interruption on different .csv files.

As far as I know the batch files are never able to have a switch that is capable of running a script. No doubt that the batch file somehow opens the file and also manages to run the macro manually. But still there are certain things that are beyond my understanding so please help and let me know what I should do.

Reply With Quote
  #2  
Old 18-06-2012
Member
 
Join Date: May 2009
Posts: 532
Re: VB Script or batch file to run Excel Macro 2010

Yeah I do understand everything; I too had the same problem. May I know what exactly the macro used to do with your .CSV files? My macro used to combine the top header and the extra spaces and other things by eliminating the rows and columns. My CSV file was nothing but an actual bill.

As I was not very well with excel (scripting was already one of the weakest thing for me) even then I managed to get a suggestion. I understood that batch file would have never played a big role for me. As I already did lots of coding in my header batch file would have assumed things as a new line, opening them in an excel was fine but however the batch would have never processed it.
Reply With Quote
  #3  
Old 19-06-2012
Member
 
Join Date: May 2009
Posts: 501
Re: VB Script or batch file to run Excel Macro 2010

I am not sure whether the CSV file works with Excel but however after trying I got that the files were opening and also my very own personal macros were present over there. But the problem arrived while using a Script; I managed to create a script for opening the file through Excel. In fact, the script did worked well and also it used to open up the file calling the Excel but the issue was with the macros. After the files were successfully opened no macros were available. Now I would go for this script but only if I get a reason why macros are playing such a huge difference.

Until now there have been few people who were able to run a batch file and successfully they got the macros available. I am not sure but I guess saving all the .xlsm to my current Start dir will play some trick but however the core trick is to just run the batch file and then let the macro auto run which will help you to save as according to your requirement.
Reply With Quote
Reply

  TechArena Community > Software > Software Development
Tags: , ,



Thread Tools Search this Thread
Search this Thread:

Advanced Search


Similar Threads for: "VB Script or batch file to run Excel Macro 2010"
Thread Thread Starter Forum Replies Last Post
How to write Macro in Microsoft Excel 2010 Glinda Tips & Tweaks 1 06-06-2012 04:28 PM
batch script to find a file stevenwhite Software Development 1 10-04-2012 12:55 PM
Excel Macro to loop a script JFN Software Development 1 27-04-2010 10:06 AM
How can I play a Wav file from batch/cmd script? NaFula Windows Vista Performance 3 13-09-2008 09:21 PM
How to create a script in a DOS batch file to do a loop? Jon Osborn Windows Server Help 2 27-05-2008 06:41 PM


All times are GMT +5.5. The time now is 09:55 AM.