Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Run Excel Macro in a Batch File
Hello,
I need to do the following in a batch process, in a DOS batch file (under Win2000): 1. Look into the certain folder, there is always one Excel file (with arbitrary names). 2. Open that file with Excel. 3. Run a certain macro, say Macro1, on that file. 4. Close Excel How should I properly approach that? Thanks in advance, DP |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Run Excel Macro in a Batch File
Hello
Would a VB script suit you? If it does, open a new text document and paste and amend accordingly the following example: Dim objXL Set objXL = WScript.CreateObject("Excel.Application") objXL.Visible = TRUE objXL.WorkBooks.Open("C:\Test\YourWorkbk.xls") objXL.run("Macro1") 'Do some other stuff Set objXL = Nothing Save the file with the .VBS extension and double-click to run HTH Cordially Pascal "DP" a écrit dans le message de rs.com... Hello, I need to do the following in a batch process, in a DOS batch file (under Win2000): 1. Look into the certain folder, there is always one Excel file (with arbitrary names). 2. Open that file with Excel. 3. Run a certain macro, say Macro1, on that file. 4. Close Excel How should I properly approach that? Thanks in advance, DP |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
Loop through all the lines in a sheet (Was: Run Excel Macro in a Batch File)
Hello,
Thank you very much! I will try that. And now, if you pardon my ignorance, let me ask you that silly question: How I can iterate in a macro through all the lines of an Excel file? Strangely, I couldn't find help on that in Excel help. Where that and similar question about the essential macro commands could be answered? Thank you, DP "papou" wrote in message ... Hello Would a VB script suit you? If it does, open a new text document and paste and amend accordingly the following example: Dim objXL Set objXL = WScript.CreateObject("Excel.Application") objXL.Visible = TRUE objXL.WorkBooks.Open("C:\Test\YourWorkbk.xls") objXL.run("Macro1") 'Do some other stuff Set objXL = Nothing Save the file with the .VBS extension and double-click to run HTH Cordially Pascal "DP" a écrit dans le message de rs.com... Hello, I need to do the following in a batch process, in a DOS batch file (under Win2000): 1. Look into the certain folder, there is always one Excel file (with arbitrary names). 2. Open that file with Excel. 3. Run a certain macro, say Macro1, on that file. 4. Close Excel How should I properly approach that? Thanks in advance, DP |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Batch file initiation from Excel macro? | Excel Discussion (Misc queries) | |||
Call a batch file from an Excel Macro | Excel Discussion (Misc queries) | |||
Call a batch file from an Excel Macro | Excel Discussion (Misc queries) | |||
Create a batch file from a number of Excel File | Excel Programming | |||
Macro to activate a Batch file ! | Excel Programming |