Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3
Default Running Excel macros through DOS

Is it possible to run Excel through the DOS shell? -- I want to open up a
text file in Excel, run a Macro that rearranges and parses text, then save it
with a date-dependent name.
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default Running Excel macros through DOS

c:\Excel.exe <cr

--
Regards,
Tom Ogilvy



"Ramesh Narasimhan" wrote in
message ...
Is it possible to run Excel through the DOS shell? -- I want to open up a
text file in Excel, run a Macro that rearranges and parses text, then save

it
with a date-dependent name.



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 733
Default Running Excel macros through DOS

Tom Ogilvy wrote...
c:\Excel.exe <cr


This is likely to produce the error message

'Excel.exe' is not recognized as an internal or external command,
operable program or batch file.

since the typical Office install doesn't put the Office program
directory in either the system or installing user's PATH. OTOH,

C:\ start excel

does work even when the Office program directory isn't in PATH - it
seems that start looks in the Registry to locate registered GUI
programs.

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default Running Excel macros through DOS

Guess I haven't started it from a command prompt lately. works OK in
windows 9x as I recall.

C:\"C:\Program Files\Microsoft Office\OFFICE11\Excel.exe"

did work in Windows XP. Obviously the correct path would need to be used.

Thanks for the correction.

--
Regards,
Tom Ogilvy



"Harlan Grove" wrote in message
oups.com...
Tom Ogilvy wrote...
c:\Excel.exe <cr


This is likely to produce the error message

'Excel.exe' is not recognized as an internal or external command,
operable program or batch file.

since the typical Office install doesn't put the Office program
directory in either the system or installing user's PATH. OTOH,

C:\ start excel

does work even when the Office program directory isn't in PATH - it
seems that start looks in the Registry to locate registered GUI
programs.



  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 733
Default Running Excel macros through DOS

Ramesh Narasimhan wrote...
Is it possible to run Excel through the DOS shell? -- I want to open up a
text file in Excel, run a Macro that rearranges and parses text, then save it
with a date-dependent name.


If you're really processing text, Excel is a poor tool to use. There
are many scripting languages that would be much easier to maintain and
run in console sessions. Windows even comes with two scripting
languages, VBScript and VJScript, which you could use to do this.

That said, you could create a workbook containing the code necessary to
process your text files in that workbook's Workbook_Open event handler.
Then run Excel using CMD.EXE's start command with command line
arguments for the text file to process and this workbook. Something
like

start excel d:\test\sample.txt d:\test\process.xls

Note: the argument order is important. Put the pathname for the text
file first followed by the pathname for the workbook. That way the text
file will be open when the workbook loads and runs its Workbook_Open
event.



Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
running excel 2003 macros Terese Excel Discussion (Misc queries) 0 January 25th 08 10:32 PM
Running Macros in Excel 2003 mickey Excel Worksheet Functions 3 May 7th 07 10:42 AM
Running macros on ALL Excel tabs tbong Excel Worksheet Functions 1 June 7th 06 08:52 PM
excel macros running slow with XP Helen@bgs Excel Programming 0 February 9th 05 01:57 PM
Running Macros in Access from Excel Simon Dowse Excel Programming 1 June 7th 04 03:48 PM


All times are GMT +1. The time now is 02:13 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"