?
Solved

Calling Excel Macro using batch script/VBScript

Posted on 2004-10-04
3
Medium Priority
?
1,338 Views
Last Modified: 2008-02-01
Hi,

How can I call an excel macro using batch or vbscript?

thanks,
shellyp
0
Comment
Question by:shellyp
1 Comment
 
LVL 6

Accepted Solution

by:
Danny Kon earned 2000 total points
ID: 12303610
I don't think you can but I think you can do what you want if you start excel and you let excel execute a macro when it starts

find the excel.exe put the path and the exe in a batch and create the macro in excel as follows:

Press Alt+F11 to go to Visual Basic Editor
In the "Project" window, double-click on "ThisWorkbook"
Enter the macro code in the workbook
   Private Sub Workbook_Open()

and put here your code

Good-Luck

Dan
0

Featured Post

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

The following is a collection of cases for strange behaviour when using advanced techniques in DOS batch files. You should have some basic experience in batch "programming", as I'm assuming some knowledge and not further explain the basics. For some…
Introduction: Recently, I got a requirement to zip all files individually with batch file script in Windows OS. I don't know much about scripting, but I searched Google and found a lot of examples and websites to complete my task. Finally, I was ab…
Loops Section Overview
Screencast - Getting to Know the Pipeline
Suggested Courses

850 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question