Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 48
Default Passing argument to Excel

Hello,

I'm trying to programmatically, in one command line, to start excel with a
user specified excel template and the template itself then automatically
loads an arbitrary file, also specified in the same command line.

I know that i can specify in one command line "..\excel.exe myTemplate.xlt"
to have excel start and automatically load the template.

But how can you also automaticaly have the template then load an arbitrary
file from the SAME command line that started excel in the first place?
ie. "..\excel.exe myTemplate.xlt c:\myFile.txt"

Thanks
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 9
Default Passing argument to Excel

This is easy, so don't worry about it. All you have to do is put "myFile.txt"
in "c:\documents and settings\USER\aplication data\excel\xlstart\" . This
folder might be under "c:\program files..." depending on your version of
windows/office. When that .txt file is stored under that xlstart thing it
will auto-load into excel whenever it is started. Also might want to change
the .txt to .cvs so you don't have to go through the wizard thing that pops
up when loading .txt files. (.cvs are comma delimited files). Hope that
helps...

P.S. I'm not sure if excel will auto-load non-.xls files, so you will just
have to try it out and see

"Bing" wrote:

Hello,

I'm trying to programmatically, in one command line, to start excel with a
user specified excel template and the template itself then automatically
loads an arbitrary file, also specified in the same command line.

I know that i can specify in one command line "..\excel.exe myTemplate.xlt"
to have excel start and automatically load the template.

But how can you also automaticaly have the template then load an arbitrary
file from the SAME command line that started excel in the first place?
ie. "..\excel.exe myTemplate.xlt c:\myFile.txt"

Thanks

  #3   Report Post  
Posted to microsoft.public.excel.programming
BW BW is offline
external usenet poster
 
Posts: 49
Default Passing argument to Excel

Hello again,

I should also add that i was able to achieve the above using Automation, ie:

Set XLApp = CreateObject("Excel.Application")

XLApp.Visible = True
XLApp.workbooks.open XLApp.TemplatesPath & "Loader.xlt"

XLApp.Run "Module1.Load", someFilename

However, i'm trying to achieve the same thing via a command line ie. at a
dos prompt, "excel.exe Loader.xlt someFilename" but i just can't seem to
figure out how to pass someFilename either to excel or the Loader.xlt
template.


"Bing" wrote:

Hello,

I'm trying to programmatically, in one command line, to start excel with a
user specified excel template and the template itself then automatically
loads an arbitrary file, also specified in the same command line.

I know that i can specify in one command line "..\excel.exe myTemplate.xlt"
to have excel start and automatically load the template.

But how can you also automaticaly have the template then load an arbitrary
file from the SAME command line that started excel in the first place?
ie. "..\excel.exe myTemplate.xlt c:\myFile.txt"

Thanks

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
Passing a UDF as an argument to a UDF puff Excel Discussion (Misc queries) 3 February 23rd 06 09:46 PM
Passing argument to excel rci Excel Programming 2 February 25th 05 01:27 PM
Passing argument to another Sub Roman Excel Programming 6 February 1st 05 09:17 PM
VBA - Passing a FUNCTION as an Argument James B Excel Programming 3 February 18th 04 03:42 PM
Passing an argument to a quote Zach Excel Programming 1 July 25th 03 01:00 AM


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