Results 1 to 3 of 3

Thread: VB Script or batch file to run Excel Macro 2010

  1. #1
    Join Date
    Apr 2012

    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.

  2. #2
    Join Date
    May 2009

    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.

  3. #3
    Join Date
    May 2009

    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.

Similar Threads

  1. How to write Macro in Microsoft Excel 2010
    By Glinda in forum Tips & Tweaks
    Replies: 1
    Last Post: 06-06-2012, 04:28 PM
  2. batch script to find a file
    By stevenwhite in forum Software Development
    Replies: 1
    Last Post: 10-04-2012, 12:55 PM
  3. Excel Macro to loop a script
    By JFN in forum Software Development
    Replies: 1
    Last Post: 27-04-2010, 10:06 AM
  4. How can I play a Wav file from batch/cmd script?
    By NaFula in forum Windows Vista Performance
    Replies: 3
    Last Post: 13-09-2008, 09:21 PM
  5. How to create a script in a DOS batch file to do a loop?
    By Jon Osborn in forum Windows Server Help
    Replies: 2
    Last Post: 27-05-2008, 06:41 PM

Tags for this Thread


Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
Page generated in 1,642,948,742.33085 seconds with 17 queries