#1   Report Post  
GeraldM
 
Posts: n/a
Default Excel startup option

if i double-click an excel template e.g. test.xlt then the spreadsheet opens
as test1.xls. if i right-click-open the same template then the spreadsheet
opens as test.xlt (then same happens if i use file-open). i am trying to open
a template from another program using the command line "run test.xlt" but
this opens the spreadsheet as test.xlt and i need it to open as test1.xls (ie
like double-clicking). does anyone know how to do this - i assumed it would
have been a startup switch option but cannot find one to do this - what does
double-clicking do that right-click-open does not do?
  #2   Report Post  
Ronald Dodge
 
Posts: n/a
Default

You could try something like the following:

Have a particular field within the template file as a number field for what
number that particular file is, and starting with the number of 0. (Note:
Your first document will actually have a 1 for it's number, if it's done via
the code as suggested below)

Setup a code separately as you have indicated by your statement in a
separate workbook. Within that code, have it do the following:


Open the file

Up the number by 1 within that file.

Save that file, so as the template is saved with an increased number in the
numbering field (the Save method of the workbook)

Save the file as a new file with that new number. I.e.
Workbooks("Test.xls").SaveAs "Test" & Workbooks("Test.xlt").Range("B2").Text
& ".xlt", xlTemplate


The main concern that would be here would be the potential you could still
end up with 2 people opening the same file and trying to save as the same
name, but the odds aren't as great given 2 different things are serving as
check points. One, as long as the workbook isn't setup as a shared
workbook, only one person can have it open in "Read-Write" mode, and 2, if
the SaveAs method does find another file with the same file name within that
same folder, it will come back as "Do you want to replace the file..." or
something like that.

Depending on how large your file is, what calculations are involved
(provided it's in automatic calculation mode), hardware specs, connections,
how many users will be using it, how often the file will be accessed, and
other factors, this may or may not be suitable.

--
Ronald R. Dodge, Jr.
Production Statistician
Master MOUS 2000

"GeraldM" wrote in message
...
if i double-click an excel template e.g. test.xlt then the spreadsheet

opens
as test1.xls. if i right-click-open the same template then the spreadsheet
opens as test.xlt (then same happens if i use file-open). i am trying to

open
a template from another program using the command line "run test.xlt" but
this opens the spreadsheet as test.xlt and i need it to open as test1.xls

(ie
like double-clicking). does anyone know how to do this - i assumed it

would
have been a startup switch option but cannot find one to do this - what

does
double-clicking do that right-click-open does not do?



  #3   Report Post  
Dave Peterson
 
Posts: n/a
Default

I bet when you double click on test.xlt, it actually creates a new workbook
named test1 (w/o the .xls extension).

If you right click on that test.xlt, you'll notice that there's a New option
(bolded) and Open (not bolded).

The bold option is the default, which means that the default action is to create
a new workbook based on this template. When you choose open, windows/excel
figures you know what you want and you want to edit the template.

I'm not sure what your other program is, but can you start excel and then create
a new workbook based on that template.

Maybe you can run a .VBS file (like an old time .BAT file) instead.

Copy this into NotePad and save this as something.VBS (change something to what
you want)

Dim XLApp
Dim XLWkb
Set XLApp = CreateObject("Excel.Application")
xlapp.visible = true
xlapp.workbooks.add "c:\myfolder1\myfolder2\test.xlt"

===
It works ok when I just double click on that .vbs file.

GeraldM wrote:

if i double-click an excel template e.g. test.xlt then the spreadsheet opens
as test1.xls. if i right-click-open the same template then the spreadsheet
opens as test.xlt (then same happens if i use file-open). i am trying to open
a template from another program using the command line "run test.xlt" but
this opens the spreadsheet as test.xlt and i need it to open as test1.xls (ie
like double-clicking). does anyone know how to do this - i assumed it would
have been a startup switch option but cannot find one to do this - what does
double-clicking do that right-click-open does not do?


--

Dave Peterson
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
Add-In causes excel 2003 to crash on startup [email protected] Excel Discussion (Misc queries) 3 July 2nd 05 08:35 PM
Automatically opening several Excel Files at startup Peo Sjoblom Excel Discussion (Misc queries) 0 June 8th 05 05:20 PM
how to remove print option in a particular excel file excel Excel Discussion (Misc queries) 1 March 14th 05 11:44 AM
Excel Key Field option? Nicki Nixon Excel Worksheet Functions 2 November 14th 04 06:56 PM
sort option is greyed out in excel mom Excel Worksheet Functions 1 November 3rd 04 03:22 PM


All times are GMT +1. The time now is 12:30 AM.

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

About Us

"It's about Microsoft Excel"