+ Reply to Thread
Results 1 to 1 of 1

Arbitrary name of new workbook - solution

  1. #1
    Registered User
    Join Date
    10-23-2009
    Location
    Sankt-Peterburg, Russia
    MS-Off Ver
    Excel 2003, Excel 2007
    Posts
    2

    Arbitrary name of new workbook - solution

    I posted this somwhere else before but if I here why not repeat.

    One day I met a problem, that tou cannot change the name of workbook other than saving it. I programmed same reports in Excel via its OLE and most of them when generated are no use of saving by user, but some are useful. On the other hand, users didn't want to name every file they want to save. When generating, program have information what it generates. For example if user starts menuitem "North region totals of sales" and selects dates Jan 1 to Mar 31 2009, it is natural to name workbook with report like "Sales 2009 Q1". And, again, saving it without of user's desicion may lead to great garbage collection on his HD. So I needed a way to name the neverbeensaved workbook.

    The solution was simple and here it is:

    1) Create new workbook
    2) Save it as template under needed name
    3) Close the workbook (which is template now)
    4) Create new workbook on the basis of this newly created template
    5) delete that newly (in "2") created template

    As a result, I have
    1) No one extra file on HD (maybe one in Recycled Bin, but I don't mind about it)
    2) Workbook, which is new (i.e. never saved) and which have name like <ArbitraryName>1 (maybe <ArbitraryName>2, 3 etc, if it is not first created WB with this instance of Excel)

    I posted it becuse I was reading such questions but I never was reading the answer. Sorry if it is because I'm bad reader and this (or other) way is commonplace.

    It would be pleasant for me to hear thanks if I helped someone :-)
    Last edited by Hexfrog; 10-29-2009 at 07:15 AM.

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1