View Single Post
  #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?