LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default I learned how to rename workbook without saving it

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
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
in three lesson i learned more about the ribbon and its new use hank673 Excel Discussion (Misc queries) 0 April 20th 09 03:21 AM
How to rename workbook that I am editing without saving? [email protected] Excel Discussion (Misc queries) 1 March 23rd 08 04:00 PM
How can I rename a Workbook? Mac Lingo[_2_] Excel Programming 2 April 23rd 05 09:24 PM
Rename a workbook! aiyer[_22_] Excel Programming 1 May 12th 04 05:12 PM
Saving a Workbook: Forcing User to Rename before Saving Rollin_Again[_6_] Excel Programming 5 April 16th 04 02:54 PM


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