Looking for Excel command line switches to create DOS batch files

  • Thread starter Thread starter regisma
  • Start date Start date
R

regisma

Hi,

I cannot find the Excel Command lines switches so I can make a DO
batch file to control Excel.

thanks

Regism
 
Regisma

Help>Index "start"(no quotes). Select "customize how Excel starts".

OR Help>Answer Wizard "start up". Select as above.

Gord Dibben Excel MVP
 
I cannot find the Excel Command lines switches so I can make a DOS
batch file to control Excel.

While batch files can start Excel, they can't control it once started. What do
you mean by 'control'? If you mean direct Excel to perform certain operations,
you can't do that with batch files. You'd need to use Windows Script (either
VBScript of JScript) to open Excel via Automation.
 
Here is a sample VBS sctipt. Save it in a standard text file with a .VBS
extention.
This one creates an Excel object, opens a workbook, sets a value, runs a VBA
routine, then tides up and closes down.

Set xlObj = CreateObject("Excel.application")
xlObj.Workbooks.Open "C:\Byg\textfile\TextFileReformat.xls"
xlObj.Range("NoOfCharsPerLine").Value = 50
xlObj.Run "ReadFromTextFile"
xlObj.ActiveWorkbook.Saved = True
xlObj.ActiveWindow.Close
xlObj.Quit

--

Regards
Andy Wiggins
www.BygSoftware.com
Home of "Save and BackUp",
"The Excel Auditor" and "Byg Tools for VBA"
 
Back
Top