Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hi, nongurus. Hi, gurus.
As far as i could found, nobody (i.e. less than half) knows how to name the newly created workbook in Excel without saving it. So did not I until yesterday. But my prayings was heard and Someone came down from Above and told me what to do. I've done it and it worked so-so. So, little more serious. As you maybe know, you can neither assign Workbook:Name property, nor supply the workbook name when executing Workbooks:Add() method. Workbook is named <Template name1 (..2, ..3, ...) until it is Workbook:SaveAs. If Workbook:Add() is called without template name, it is named Book1. So, the way of user naming comes from this convention, and is: (The code fragments shown below has come from language not common to everybody - Progress ABL - but seems to me that it is quit understandable) I. When creating from template I1) Copy template to tempdir under name you like. temporary-template-file = Session:temp-dir + 'Name I Like .xlt'. OS-COPY value(template-file) value(temporary-template-file). I2) Create workbook from this template ChWorkBook = chExcel:Workbooks:Add(temporary-template-file). I3) Delete temporary file OS-DELETE value(temporary-template-file). II. When creating not from template II1) Create new workbook II2) Save it as template with name you like in tempdir II3) GOTO I2 Unfortunaly, using this workaround, you always create the workbook with "1" in the end of the name. But what to do with this, I don't know. In my case, fortunaly, Workbook:Name was to end with time, and I tricked - my seconds always end with 1. I hope I helped someone :-) |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
in three lesson i learned more about the ribbon and its new use | Excel Discussion (Misc queries) | |||
How to rename workbook that I am editing without saving? | Excel Discussion (Misc queries) | |||
How can I rename a Workbook? | Excel Programming | |||
Rename a workbook! | Excel Programming | |||
Saving a Workbook: Forcing User to Rename before Saving | Excel Programming |