Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 791
Default Are there command line parameters for Excel?

I am looking for a way from a batch file to start excel to open a specific
xls file and then save it in tab delimited text format and then close the new
..txt file.
I have a PERL script that requires the file to be in the .txt format in
order to parse it.
I have many files that require this operation and it would be easier to
drive this process with this type of functionality.


  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 9,101
Default Are there command line parameters for Excel?

Yes Here is what I used.

excel /read c:\temp\book6.xls

i found the answer a few months aggo att the microsoft webpage

http://office.microsoft.com/en-us/ex...580301033.aspx

"Michael" wrote:

I am looking for a way from a batch file to start excel to open a specific
xls file and then save it in tab delimited text format and then close the new
.txt file.
I have a PERL script that requires the file to be in the .txt format in
order to parse it.
I have many files that require this operation and it would be easier to
drive this process with this type of functionality.


  #3   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 524
Default Are there command line parameters for Excel?

Wed, 1 Aug 2007 12:30:03 -0700 from Joel
:
Yes Here is what I used.

excel /read c:\temp\book6.xls

i found the answer a few months aggo att the microsoft webpage

http://office.microsoft.com/en-us/ex...580301033.aspx


Unfortunately, arrogant Microsoft won't display that page because I'm
using a real browser instead of Internet Explorer. There was
something about checking to see whether I have Office 2007 -- itself
pretty darn arrogant.

--
"The Internet is famously powered by the twin engines of
bitterness and contempt." -- Nathan Rabin, /The Onion/
Stan Brown, Oak Road Systems, Tompkins County, New York, USA
http://OakRoadSystems.com/
  #4   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 22,906
Default Are there command line parameters for Excel?

Stan

You could always use Excel Help on "startup switches"


Gord Dibben MS Excel MVP

On Sat, 4 Aug 2007 20:51:32 -0400, Stan Brown
wrote:

Wed, 1 Aug 2007 12:30:03 -0700 from Joel
:
Yes Here is what I used.

excel /read c:\temp\book6.xls

i found the answer a few months aggo att the microsoft webpage

http://office.microsoft.com/en-us/ex...580301033.aspx


Unfortunately, arrogant Microsoft won't display that page because I'm
using a real browser instead of Internet Explorer. There was
something about checking to see whether I have Office 2007 -- itself
pretty darn arrogant.


  #5   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 524
Default Are there command line parameters for Excel?

Sat, 04 Aug 2007 19:13:35 -0700 from <Gord Dibben
<gorddibbATshawDOTca:

You could always use Excel Help on "startup switches"


Agreed, and in fact that's how I got the information when I was
looking for it a few months ago.

But I am just agog at the barriers Microsoft puts up to getting
information from its Web site. There seems no good reason for it.

--
"The Internet is famously powered by the twin engines of
bitterness and contempt." -- Nathan Rabin, /The Onion/
Stan Brown, Oak Road Systems, Tompkins County, New York, USA
http://OakRoadSystems.com/


  #6   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 8,651
Default Are there command line parameters for Excel?

"Stan Brown" wrote in message
t...
Wed, 1 Aug 2007 12:30:03 -0700 from Joel
:
Yes Here is what I used.

excel /read c:\temp\book6.xls

i found the answer a few months aggo att the microsoft webpage

http://office.microsoft.com/en-us/ex...580301033.aspx


Unfortunately, arrogant Microsoft won't display that page because I'm
using a real browser instead of Internet Explorer. There was
something about checking to see whether I have Office 2007 -- itself
pretty darn arrogant.


I don't know which real browser you were using, but that page will display
in Mozilla's Firefox.
--
David Biddulph
Rowing web pages at
http://www.biddulph.org.uk/


  #7   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 524
Default Are there command line parameters for Excel?

Sun, 5 Aug 2007 09:11:42 +0100 from <"David Biddulph" <groups [at]
biddulph.org.uk:
"Stan Brown" wrote in message
t...
Wed, 1 Aug 2007 12:30:03 -0700 from Joel
:
Yes Here is what I used.

excel /read c:\temp\book6.xls

i found the answer a few months aggo att the microsoft webpage

http://office.microsoft.com/en-us/ex...580301033.aspx


Unfortunately, arrogant Microsoft won't display that page because I'm
using a real browser instead of Internet Explorer. There was
something about checking to see whether I have Office 2007 -- itself
pretty darn arrogant.


I don't know which real browser you were using, but that page will
display in Mozilla's Firefox.


The real browser I'm using is Mozilla. As I mentioned, it just
displayed a page saying Microsoft was checking whether I have Office
2007, and stuck there.

--
"The Internet is famously powered by the twin engines of
bitterness and contempt." -- Nathan Rabin, /The Onion/
Stan Brown, Oak Road Systems, Tompkins County, New York, USA
http://OakRoadSystems.com/
  #8   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 390
Default Are there command line parameters for Excel?

In , Stan Brown
spake thusly:

Sun, 5 Aug 2007 09:11:42 +0100 from <"David Biddulph" <groups
[at] biddulph.org.uk:

"Stan Brown" wrote in message
t...


http://office.microsoft.com/en-us/ex...580301033.aspx


Unfortunately, arrogant Microsoft won't display that page
because I'm using a real browser instead of Internet
Explorer. There was something about checking to see whether I
have Office 2007 -- itself pretty darn arrogant.


I don't know which real browser you were using, but that page
will display in Mozilla's Firefox.


The real browser I'm using is Mozilla. As I mentioned, it just
displayed a page saying Microsoft was checking whether I have
Office 2007, and stuck there.


I don't have Office 2007, do use Firefox, and had zero trouble
looking at that page, even when i declined cookies. No problems
at all. It's a useful page.

Microsoft does lots one could criticize, but this seems not to be one
of them.

--
dman
  #9   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 284
Default Are there command line parameters for Excel?

Michael,

The example below is a vbScript that would open the xls file
"C:\Test\RawTable.xls", save it as a csv file named "C:\Temp\RawTable.txt"
and then convert the csv file to a tab delimited file with the same name,
"C:\Temp\RawTable.txt" and finally close the txt file.

_____________________

Const xlCSV = 6
Const xlDoNotSaveChanges = 2
Const ForReading = 1
Const ForWriting = 2

' Open the Excel file and save a copy as a CSV file

Set objExcel = CreateObject("Excel.Application")

Set objWkbk = objExcel.Workbooks.Open("C:\Test\RawTable.xls")

objExcel.DisplayAlerts = False

objWkbk.SaveAs "C:\Temp\RawTable.txt", xlCSV
objWkbk.Close xlDoNotSaveChanges

objExcel.DisplayAlerts = True
objExcel.Quit


' Open the CSV file and convert to a tab delimited file

Set FSO = CreateObject("Scripting.FileSystemObject")
Set objFile = FSO.OpenTextFile("C:\Temp\RawTable.txt", ForReading)
strContents = objFile.ReadAll
objFile.Close
strContents = Replace(strContents, ",", vbTab)
Set objFile = FSO.OpenTextFile("C:\Temp\RawTable.txt", ForWriting)
objFile.Write StrContents
objFile.Close


______________________

Steve Yandl



"Michael" wrote in message
...
I am looking for a way from a batch file to start excel to open a specific
xls file and then save it in tab delimited text format and then close the
new
.txt file.
I have a PERL script that requires the file to be in the .txt format in
order to parse it.
I have many files that require this operation and it would be easier to
drive this process with this type of functionality.




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
What are the possible command-line arguments in Excel? d2reason Excel Discussion (Misc queries) 2 June 4th 07 09:39 PM
command line Excel Script [email protected] Excel Discussion (Misc queries) 0 August 22nd 06 01:23 PM
What is the command-line print switch in Excel? eeidfn Excel Discussion (Misc queries) 5 February 17th 06 11:59 PM
How do i convert excel to csv in command line? ( not save as) F1 Excel Discussion (Misc queries) 1 June 1st 05 03:51 AM
Load DBF file into Excel on command line? prospects Excel Discussion (Misc queries) 0 January 30th 05 12:39 AM


All times are GMT +1. The time now is 02:36 PM.

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"