Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Random file name
Is there a way to create a random/unique workbook name in Excel that
can be created by a macro at the beginning, the macro continues on with its chores, and then, at the end, deletes that workbook? The workbook is temporary in nature and does not need to exist after the macro executes. I am more familiar with writing code in Foxpro than I am with Excel. Ahí namá, Robert Melbo |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Random file name
You could probably get a zillion hits using "unique workbook name" at Google
groups. http://groups.google.com/grphp?hl=en Nevertheless, look for the posting from 7/17/2003 whose subject is "Automatically generate a unique file name via macro" Bob Kilmer "Robert Melbo" wrote in message ... Is there a way to create a random/unique workbook name in Excel that can be created by a macro at the beginning, the macro continues on with its chores, and then, at the end, deletes that workbook? The workbook is temporary in nature and does not need to exist after the macro executes. I am more familiar with writing code in Foxpro than I am with Excel. Ahí namá, Robert Melbo |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
Random file name
Just use time as a source for the name - it isn't random, but it shouldn't
be duplicated sName = Format(now,"yyyymmdd_hhmmss") & ".xls" to demo from the immediate window: ? Format(now,"yyyymmdd_hhmmss") & ".xls" 20030721_095957.xls But you can create a new workbook and work with it, then Activeworkbook.Close SaveChanges:=false without giving it a name or saving it. Regards, Tom Ogilvy "Robert Melbo" wrote in message ... Is there a way to create a random/unique workbook name in Excel that can be created by a macro at the beginning, the macro continues on with its chores, and then, at the end, deletes that workbook? The workbook is temporary in nature and does not need to exist after the macro executes. I am more familiar with writing code in Foxpro than I am with Excel. Ahí namá, Robert Melbo |
#4
Posted to microsoft.public.excel.programming
|
|||
|
|||
Random file name
"Robert Melbo" wrote in message ... Is there a way to create a random/unique workbook name in Excel that can be created by a macro at the beginning, the macro continues on with its chores, and then, at the end, deletes that workbook? The workbook is temporary in nature and does not need to exist after the macro executes. Why would you want to do this ? If you open an Excel session you get a workbook who's name defaults to Book1 but if you dont save it when you close the session it never gets written to disk anyway. If you really want a unique name for the workbook generate a GUID http://support.microsoft.com:80/supp...NoWebContent=1 Keith |
#5
Posted to microsoft.public.excel.programming
|
|||
|
|||
Random file name
If you really do need to create a temp name, Excel vba has a method that
generates random names. It's advertised for this purpose. You would have to adjust it to fit your needs. There are many other different options besides this though. Sub Demo() Dim TempFileName TempFileName = Left$("Excel_" & CreateObject("Scripting.FileSystemObject").GetTemp Name, 14) Debug.Print TempFileName End Sub returns: Excel_radBD8CE -- Dana DeLouis I am using Windows XP & Office XP = = = = = = = = = = = = = = = = = "Robert Melbo" wrote in message ... Is there a way to create a random/unique workbook name in Excel that can be created by a macro at the beginning, the macro continues on with its chores, and then, at the end, deletes that workbook? The workbook is temporary in nature and does not need to exist after the macro executes. I am more familiar with writing code in Foxpro than I am with Excel. Ahí namá, Robert Melbo |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Sorting random Data created from a random formula | Excel Discussion (Misc queries) | |||
Random help please | Excel Worksheet Functions | |||
Non-random numbers generated by excel's data analysis random gener | Excel Worksheet Functions | |||
Non-random numbers generated by excel's data analysis random gener | Excel Discussion (Misc queries) | |||
How do I find random number in list of random alpha? (Position is. | Excel Discussion (Misc queries) |