LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 107
Default Command line parameters to Excel

I've just briefly tested a horrible kludge using a batch file and an
environment variable.
This is tested on Windows XP only, with the call made from a desktop
shortcut, or from shell within VB5.

I created a 2-line batch file, callXL.bat

set xl_command_line=%2 %3 %4 %5 %6 %7 %8 %9
%1

I then call the batch file with the workbook path as the first
parameter, followed by any other parameters

(in a shortcut)
C:\callXL.bat "C:\SJGtest.xls" hello world

(or from VB)
Shell "C:\callXL.bat ""C:\SJGtest.xls"" hello world"

and, in the workbook, it is retrieved using:

Private Sub Test()
MsgBox Environ("xl_command_line")
End Sub



riveaira < wrote:
I would LOVE to know how to do this too! Has anyone found a way? ;)


---
Message posted from http://www.ExcelForum.com/


 
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
Are there command line parameters for Excel? Michael Excel Discussion (Misc queries) 9 August 5th 07 06:29 PM
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
command line excel to run macros Anthony Ryan Excel Programming 0 August 10th 03 02:06 PM
Command line parameters into a macro Donemowe Excel Programming 3 August 6th 03 09:12 AM


All times are GMT +1. The time now is 08:41 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"